1
0
Эх сурвалжийг харах

fix: auto-hide dashboard window when executing workflow (#1295)

Ahmad Kholid 1 жил өмнө
parent
commit
af7157d7c9

+ 6 - 0
src/workflowEngine/blocksHandler/handlerActiveTab.js

@@ -19,6 +19,7 @@ async function activeTab(block) {
       active: true,
       url: '*://*/*',
     };
+    let dashboardWindowId = null;
 
     if (BROWSER_TYPE === 'firefox') {
       tabsQuery.currentWindow = true;
@@ -36,6 +37,7 @@ async function activeTab(block) {
             focused: false,
             state: 'minimized',
           });
+          dashboardWindowId = browserWindow.id;
         } else if (browserWindow.focused) {
           windowId = browserWindow.id;
         }
@@ -59,6 +61,10 @@ async function activeTab(block) {
       tabsQuery.currentWindow = true;
     }
 
+    if (dashboardWindowId) {
+      await browser.windows.update(dashboardWindowId, { state: 'normal' });
+    }
+
     const [tab] = await browser.tabs.query(tabsQuery);
     if (!tab) {
       throw new Error("Can't find active tab");