Bläddra i källkod

[fix] deposit show popup

wenliming 2 år sedan
förälder
incheckning
589dd7c914
2 ändrade filer med 22 tillägg och 0 borttagningar
  1. 19 0
      src/logic/content/twitter.js
  2. 3 0
      src/view/popup/currency-detail.vue

+ 19 - 0
src/logic/content/twitter.js

@@ -928,6 +928,7 @@ export function init() {
     }
 
     if (window.location.host.includes('twitter.com')) {
+        onPageVisbile();
         renderDom();
         showNFTCard()
         showNFTGroupIcon()
@@ -971,6 +972,24 @@ export function init() {
     });
 }
 
+function onPageVisbile() {
+    document.addEventListener('visibilitychange', function () {
+        let isHidden = document.hidden;
+        if (!isHidden) {
+            depositUSShowPopupPage();
+        }
+    });
+}
+
+const depositUSShowPopupPage = async () => {
+    let {form = ''} = await getChromeStorage('achPayData') || {};
+    if(form == 'popupPage') {
+        showPopupPage();
+        chrome.storage.local.remove("achPayData");
+    }
+}
+
+
 function checkHasSliderDeBtn() {
     let deBtn = document.getElementById('de-btn');
     let deBtn3 = document.getElementById('de-btn3');

+ 3 - 0
src/view/popup/currency-detail.vue

@@ -294,6 +294,9 @@ const confirmDeposit = (params) => {
   };
   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