Jelajahi Sumber

[edit] popup show

wenliming 2 tahun lalu
induk
melakukan
fb9fdb474c

+ 2 - 2
src/logic/content/twitter.js

@@ -981,9 +981,9 @@ function onPageVisbile() {
 }
 
 const depositUSShowPopupPage = async () => {
-    let {form = ''} = await getChromeStorage('achPayData') || {};
+    let {form = '', path} = await getChromeStorage('achPayData') || {};
     if(form == 'popupPage') {
-        showPopupPage();
+        showPopupPage({path});
         chrome.storage.local.remove("achPayData");
     }
 }

+ 0 - 1
src/view/popup/components/tabbar.vue

@@ -160,7 +160,6 @@ const onMessage = () => {
 }
 
 const msgListener = (req, sender, sendResponse) => {
-    ;
     switch (req.actionType) {
         case 'CONTENT_POPUP_PAGE_SHOW':
             init();

+ 26 - 4
src/view/popup/currency-detail.vue

@@ -71,7 +71,7 @@
 </template>
 
 <script setup>
-import { ref, onMounted, inject, reactive } from "vue";
+import { ref, onMounted, inject, reactive, onBeforeUnmount } from "vue";
 import router from "@/router/popup.js";
 import Report from "@/log-center/log";
 import { getStorage } from "@/uilts/help";
@@ -261,7 +261,6 @@ const showSendGiveawayDialog = (params = {}) => {
       showCurrencySelect.value = true;
       currencyOpertionType = "SEND";
   } else {
-    console.log(params,'params')
       setLocalSelectCurrencyInfo(params)
       setTimeout(() => {
         chrome.runtime.sendMessage({ 
@@ -294,8 +293,11 @@ const confirmDeposit = (params) => {
   };
   let guideUrl = chrome.runtime.getURL('/iframe/ach-cashier.html');
   setChromeStorage({ achPayInfo : JSON.stringify(achPayInfo)});
+  let str = window.location.hash + '&refresh=true';
+  let path = str.substring(1, str.length);
   setChromeStorage({ achPayData : JSON.stringify({
-    form: 'popupPage'
+    form: 'popupPage',
+    path
   })});
 
   chrome.tabs.create({
@@ -328,13 +330,28 @@ const onDepositAmountInput = async (params = {}) => {
   }
 }
 
+
+const onMessage = () => {
+    chrome.runtime.onMessage.addListener(msgListener)
+}
+
+const msgListener = (req, sender, sendResponse) => {
+    switch (req.actionType) {
+        case 'CONTENT_POPUP_PAGE_SHOW':
+            let {refresh = false} = router.currentRoute.value.query;
+            if(refresh && currencyInfo.value.tokenSymbol) {
+              onRefresh();
+            }
+            break;
+    }
+}
+
 onMounted(() => {
     let {params = '{}'} = router.currentRoute.value.query;
 
     let {currencies = [], totalBalance = 0, totalUsdEstimateBalance = 0} =  JSON.parse(params);
 
     currenciesData.value = currencies;
-
     if(currencies.length) {
       currencyInfo.value = {
         ...currencies[0],
@@ -351,6 +368,11 @@ onMounted(() => {
     } else {
       showSendBtn.value = true;
     }
+    onMessage();
+})
+
+onBeforeUnmount(() => {
+    chrome.runtime.onMessage.removeListener(msgListener);
 })
 
 </script>

+ 0 - 1
src/view/popup/tabbar-page/message/index.vue

@@ -481,7 +481,6 @@ const onMessage = () => {
 }
 
 const msgListener = (req, sender, sendResponse) => {
-  ;
   switch (req.actionType) {
     case 'CONTENT_POPUP_PAGE_SHOW':
       init();

+ 0 - 1
src/view/popup/tabbar-page/nft/index.vue

@@ -84,7 +84,6 @@ const onMessage = () => {
 }
 
 const msgListener = (req, sender, sendResponse) => {
-  ;
   switch (req.actionType) {
     case 'CONTENT_POPUP_PAGE_SHOW':
       getNFTListMine();

+ 0 - 1
src/view/popup/tabbar-page/wallter/popup.vue

@@ -204,7 +204,6 @@ const onMessage = () => {
 }
 
 const msgListener = (req, sender, sendResponse) => {
-    ;
     switch (req.actionType) {
         case 'CONTENT_POPUP_PAGE_SHOW':
             init();