Browse Source

fix unexpected sync error

Gerald 8 years ago
parent
commit
c3a2e70ace
2 changed files with 5 additions and 1 deletions
  1. 1 1
      src/background/utils/db.js
  2. 4 0
      src/options/app.js

+ 1 - 1
src/background/utils/db.js

@@ -336,7 +336,7 @@ export function removeScript(id) {
     storage.code.remove(id);
     storage.value.remove(id);
   }
-  return browser.runtime.sendMessage({
+  browser.runtime.sendMessage({
     cmd: 'RemoveScript',
     data: id,
   });

+ 4 - 0
src/options/app.js

@@ -93,5 +93,9 @@ function initMain() {
         initScript(updated);
       }
     },
+    RemoveScript(id) {
+      const i = store.scripts.findIndex(script => script.props.id === id);
+      if (i >= 0) store.scripts.splice(i, 1);
+    },
   });
 }