Rift-15726 compress code in production environment
[osm/UI.git] / skyquake / plugins / logging / src / loggingStore.js
index d8f0d70..e95e657 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 
+ *
  *   Copyright 2016 RIFT.IO Inc
  *
  *   Licensed under the Apache License, Version 2.0 (the "License");
@@ -126,14 +126,18 @@ class LoggingStore {
                 // TODO/NOTE: Can't delete from model as sending a top-level payload with
                 // missing elements is not allowed!
                 // When backend supports it, in loggingSource change the order of operations
-                // Delete first followed by save/put.
-                // _.remove(loggingConfig.sinks[sinkIndex].filter.category, {
-                //   name: catsev.name
-                // });
+                // // Delete first followed by save/put.
+                _.remove(loggingConfig.sinks[sinkIndex].filter.category, {
+                  name: catsev.name
+                });
               } else {
                 sink.filter.category[catIndex] = catsev;
               }
             } else {
+              _.remove(nulledCategories, (v) => v == catsev.name);
+              this.setState({
+                nulledCategories: nulledCategories
+              });
               sink.filter.category.push(catsev);
             }
           } else {
@@ -212,4 +216,4 @@ class LoggingStore {
   }
 }
 
-export default alt.createStore(LoggingStore);
+export default alt.createStore(LoggingStore, 'LoggingStore');