ソースを参照

fix: while loop always return false (#601)

Ahmad Kholid 2 年 前
コミット
fa03caf5e5

+ 2 - 2
src/background/workflowEngine/blocksHandler/handlerWhileLoop.js

@@ -1,12 +1,12 @@
 import testConditions from '@/utils/testConditions';
 import { getBlockConnection } from '../helper';
 
-async function whileLoop({ data, outputs }, { refData }) {
+async function whileLoop({ data, outputs, id }, { refData }) {
   const conditionPayload = {
     refData,
     activeTab: this.activeTab.id,
     sendMessage: (payload) =>
-      this._sendMessageToTab({ ...payload, isBlock: false }),
+      this._sendMessageToTab({ ...payload.data, name: 'conditions', id }),
   };
   const result = await testConditions(data.conditions, conditionPayload);
   const nextBlockId = getBlockConnection({ outputs }, result.isMatch ? 1 : 2);

+ 2 - 2
src/content/index.js

@@ -153,8 +153,8 @@ function messageListener({ data, source }) {
           .then(resolve)
           .catch((error) => {
             const elNotFound = error.message === 'element-not-found';
-            const selectLoopItem = data.data?.selector?.includes('automa-loop');
-            if (elNotFound && selectLoopItem) {
+            const isLoopItem = data.data?.selector?.includes('automa-loop');
+            if (elNotFound && isLoopItem) {
               const findLoopEl = data.loopEls.find(({ url }) =>
                 window.location.href.includes(url)
               );

+ 0 - 2
src/newtab/index.js

@@ -1,5 +1,4 @@
 import { createApp } from 'vue';
-import inspector from 'vue-inspector-agnostic';
 import App from './App.vue';
 import router from './router';
 import store from '../store';
@@ -18,7 +17,6 @@ createApp(App)
   .use(vueI18n)
   .use(vueToastification)
   .use(vRemixicon, icons)
-  .use(inspector)
   .mount('#app');
 
 if (module.hot) module.hot.accept();