Browse Source

fix: prevent opening dashboard when workflow disabled

Ahmad Kholid 2 years ago
parent
commit
5fb733ae12

+ 2 - 0
src/background/BackgroundWorkflowTriggers.js

@@ -10,6 +10,8 @@ import BackgroundUtils from './BackgroundUtils';
 import BackgroundWorkflowUtils from './BackgroundWorkflowUtils';
 
 async function executeWorkflow(workflowData, options) {
+  if (workflowData.isDisabled) return;
+
   const isMV2 = browser.runtime.getManifest().manifest_version === 2;
   const context = workflowData.settings.execContext;
   if (isMV2 || context === 'background') {

+ 2 - 0
src/background/BackgroundWorkflowUtils.js

@@ -40,6 +40,8 @@ class BackgroundWorkflowUtils {
   }
 
   static async executeWorkflow(workflowData, options) {
+    if (workflowData.isDisabled) return;
+
     startWorkflowExec(workflowData, options, false);
   }
 }