|
@@ -37,6 +37,7 @@ import { setBadgeInfo, hideBadge } from "@/logic/background/twitter";
|
|
|
|
|
|
import { nftListMine } from "@/http/nft.js";
|
|
|
import { getAllMessageInfo } from "@/http/messageApi"
|
|
|
+import { getChromeStorage } from "@/uilts/chromeExtension";
|
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
@@ -129,10 +130,8 @@ const setActiveTab = () => {
|
|
|
})
|
|
|
};
|
|
|
|
|
|
-const getNFTListMine = (isNeedProps = true) => {
|
|
|
- if(isNeedProps) {
|
|
|
- if(!props.userInfo.accessToken) return;
|
|
|
- }
|
|
|
+const getNFTListMine = (params = {}) => {
|
|
|
+ if(!props.userInfo.accessToken && !params.accessToken) return;
|
|
|
nftListMine({
|
|
|
params: NFTReqParams.params,
|
|
|
}).then((res) => {
|
|
@@ -172,7 +171,7 @@ const msgListener = (req, sender, sendResponse) => {
|
|
|
switch (req.actionType) {
|
|
|
case 'CONTENT_POPUP_PAGE_SHOW':
|
|
|
init();
|
|
|
- getNFTListMine(false);
|
|
|
+ getNFTListMine();
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
@@ -188,12 +187,20 @@ const onPageVisbile = () => {
|
|
|
let isHidden = document.hidden;
|
|
|
if (!isHidden) {
|
|
|
setTimeout(() => {
|
|
|
- getNFTListMine(false);
|
|
|
- }, 1200)
|
|
|
+ getUserInfo((res) => {
|
|
|
+ getNFTListMine(res);
|
|
|
+ })
|
|
|
+ }, 1200);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+const getUserInfo = (cb) => {
|
|
|
+ getChromeStorage("userInfo", (res) => {
|
|
|
+ cb && cb(res || {});
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
onMessage();
|
|
|
init();
|