wenliming 2 år sedan
förälder
incheckning
7161a3eef3

+ 4 - 13
src/logic/background/twitter.js

@@ -304,19 +304,10 @@ export function onInstalledCreateTab() {
             case 'nft_group_info':
                 if (res && res.twitterAccount) {
                     created_detail = true
-                    // setChromeStorage({ groupTabData: JSON.stringify({
-                    //     deTabVal: 'deGroupTab'
-                    // })})
-                    chrome.storage.local.set({
-                        groupTabData: JSON.stringify({
-                            deTabVal: 'deGroupTab'
-                        })
-                    }, (response) => {
-                        url = `https://twitter.com/${res.twitterAccount}`
-                        chrome.tabs.create({
-                            url
-                        });
-                    })
+                    url = `https://twitter.com/${res.twitterAccount}#selectDeNftGroupTab`
+                    chrome.tabs.create({
+                        url
+                    });
                 }
                 break
             // toolbox

+ 4 - 11
src/logic/content/twitter.js

@@ -1977,17 +1977,10 @@ const hiddenMaskWeb3Tab = (count) => {
  */
 const checkNeedSelectGroupTab = () => {
     if (window.location.pathname != '/home') {
-        setTimeout(() => {
-            getChromeStorage('groupTabData', (res) => {
-                console.log('groupTabData', res);
-                if (res && res.deTabVal == 'deGroupTab') {
-                    chrome.storage.local.remove("groupTabData");
-                    setTimeout(() => {
-                        selectGroupTab();
-                    }, 300)
-                }
-            })
-        }, 1300)
+        if(window.location.hash == '#selectDeNftGroupTab') {
+            window.location.hash = '';
+            selectGroupTab();
+        }
     }
 }
 

+ 1 - 6
src/view/iframe/nft/group-card.vue

@@ -49,12 +49,7 @@ const jumpUserPage = () => {
                 }
             )
         } else {
-            setChromeStorage({
-                groupTabData: JSON.stringify({
-                    deTabVal: 'deGroupTab'
-                })
-            })
-            window.open(`https://twitter.com/${detail.value.defaultTwitterAccount}`)
+            window.open(`https://twitter.com/${detail.value.defaultTwitterAccount}#selectDeNftGroupTab`)
         }
     })
 }

+ 1 - 4
src/view/iframe/tab-group/joined-group-list.vue

@@ -23,10 +23,7 @@ import { sendChromeTabMessage, setChromeStorage } from '@/uilts/chromeExtension.
 let groupListDom = ref(null);
 
 const clickHandler = (params) => {
-    setChromeStorage({ groupTabData: JSON.stringify({
-        deTabVal: 'deGroupTab'
-    })})
-    let url = `https://twitter.com/${params.defaultTwitterAccount}`;
+    let url = `https://twitter.com/${params.defaultTwitterAccount}#selectDeNftGroupTab`;
     sendMessageToContent({
         actionType: 'IFRAME_PAGE_JUMP',
         data: {