Explorar el Código

fix: query value

Ahmad Kholid hace 1 año
padre
commit
1332572991
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  1. 5 1
      src/execute/index.js

+ 5 - 1
src/execute/index.js

@@ -1,3 +1,4 @@
+import { parseJSON } from '@/utils/helper';
 import { sendMessage } from '@/utils/message';
 import { sendMessage } from '@/utils/message';
 import Browser from 'webextension-polyfill';
 import Browser from 'webextension-polyfill';
 
 
@@ -11,7 +12,10 @@ function getWorkflowDetail() {
   const { 1: workflowId } = pathname.split('/');
   const { 1: workflowId } = pathname.split('/');
 
 
   searchParams.forEach((key, value) => {
   searchParams.forEach((key, value) => {
-    variables[key] = decodeURIComponent(value);
+    const varValue = parseJSON(decodeURIComponent(value), '##_empty');
+    if (varValue === '##_empty') return;
+
+    variables[key] = varValue;
   });
   });
 
 
   return { workflowId: workflowId ?? '', variables };
   return { workflowId: workflowId ?? '', variables };