update from RIFT as of 696b75d2fe9fb046261b08c616f1bcf6c0b54a9b third try
[osm/UI.git] / skyquake / plugins / logging / src / loggingSource.js
index bf2f06a..dfba167 100644 (file)
@@ -75,6 +75,9 @@ export default {
                 allowDuplicateEvents: loggingConfig.allowDuplicateEvents
               },
               success: function(data) {
+                if (!loggingConfig.allowDuplicateEvents) {
+                  delete state.loggingConfig.allowDuplicateEvents
+                }
                 resolve(data);
               },
               error: function(error) {
@@ -84,23 +87,23 @@ export default {
               }
             }))
           }
-          // if(nulledCategories.length > 0) {
-          //   remove = $.ajax({
-          //     // url: apiUrl('api/config/default-severity'),
-          //     url: apiUrl('api/config/default-syslog-severity/' + nulledCategories.join(',')),
-          //     type: 'DELETE',
-          //     beforeSend: Utils.addAuthorizationStub,
-          //     success: function(data) {
-          //       resolve(data);
-          //     },
-          //     error: function(error) {
-          //       console.log("There was an error updating the logging config data",
-          //         error);
-          //       reject(error);
-          //     }
-          //   });
-          //   promises.push(remove);
-          // }
+          if(nulledCategories.length > 0) {
+            remove = $.ajax({
+              // url: apiUrl('api/config/default-severity'),
+              url: apiUrl('api/config/default-syslog-severity/' + nulledCategories.join(',')),
+              type: 'DELETE',
+              beforeSend: Utils.addAuthorizationStub,
+              success: function(data) {
+                resolve(data);
+              },
+              error: function(error) {
+                console.log("There was an error updating the logging config data",
+                  error);
+                reject(error);
+              }
+            });
+            promises.push(remove);
+          }
           Promise.all(promises).then(function(data) {
             return $.ajax({
                 url: apiUrl('api/aggregate'),