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