ソースを参照

[edit] select tab

wenliming 2 年 前
コミット
9d7b765f5f
1 ファイル変更7 行追加5 行削除
  1. 7 5
      src/logic/content/twitter.js

+ 7 - 5
src/logic/content/twitter.js

@@ -20,6 +20,9 @@ let systemInfo = {
     theme: 'light'
 }
 
+let fixProfileTabAutoTimer = null;
+
+
 function twitterPinLogin() {
     if (window.location.href == 'https://api.twitter.com/oauth/authorize') {
         let code = document.querySelector('code')
@@ -844,10 +847,7 @@ export function init() {
     initBuyNFT();
     addJoinedGroupList();
     getSysTheme();
-
-    addGroupTab()
-    fixProfileTabAutoSwitch();
-
+    addGroupTab();
 
     getChromeStorage("popupShowPublishDialog", (res) => {
         console.log("popupShowPublishDialog", res);
@@ -1316,6 +1316,8 @@ export const showTwitterPost = (data) => {
             addGroupTab();
         }, 2000)
     }
+    clearInterval(fixProfileTabAutoTimer);
+    fixProfileTabAutoSwitch();
     // addPublishTipsIframe({ type: 'nft' })
 }
 
@@ -2102,7 +2104,7 @@ const getGroupTabContentNode = () => {
 }
 
 const fixProfileTabAutoSwitch = () => {
-    setInterval(() => {
+    fixProfileTabAutoTimer = setInterval(() => {
         let groupTab = getGroupTabNode();
         let tweetTab = document.querySelector('a[aria-selected="true"]');