浏览代码

[fix] close window

wenliming 2 年之前
父节点
当前提交
287168c00a
共有 2 个文件被更改,包括 10 次插入7 次删除
  1. 8 2
      src/logic/background/denet.js
  2. 2 5
      src/view/popup/currency-detail.vue

+ 8 - 2
src/logic/background/denet.js

@@ -6,9 +6,15 @@ export const closeAchPayNoticeHandler = async () => {
     if(res.url.startsWith(payAchNoticeUrl)) {
         chrome.tabs.remove(
             res.id, () => {
-                getChromeStorage('achPayInfo', (res) => {
+                getChromeStorage('achPayInfo', (result) => {
+                    let {tab, form} = result || {};
                     chrome.storage.local.remove("achPayInfo");
-                    if(res && res.tab) {
+                    if(form == 'popupPage') {
+                        setChromeStorage({ achPayData : JSON.stringify({
+                            form: 'popupPage'
+                        })});
+                    }
+                    if(tab) {
                         chrome.tabs.highlight({ windowId: res.tab.windowId, tabs: res.tab.index })
                     }
                 })

+ 2 - 5
src/view/popup/currency-detail.vue

@@ -290,14 +290,11 @@ const confirmDeposit = (params) => {
   depositDesc.value = '';
 
   let achPayInfo = {
-      amountValue: finalAmountData.value.finalAmountValue
+      amountValue: finalAmountData.value.finalAmountValue,
+      form: 'popupPage'
   };
   let guideUrl = chrome.runtime.getURL('/iframe/ach-cashier.html');
   setChromeStorage({ achPayInfo : JSON.stringify(achPayInfo)});
-  setChromeStorage({ achPayData : JSON.stringify({
-    form: 'popupPage'
-  })});
-
   chrome.tabs.create({
     url: guideUrl
   });