wenliming il y a 2 ans
Parent
commit
9408bb968e
1 fichiers modifiés avec 28 ajouts et 5 suppressions
  1. 28 5
      src/logic/content/twitter.js

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

@@ -1299,6 +1299,11 @@ export const showTwitterPost = (data) => {
     content_get_nft_post_pre({
         groupId: data.groupId
     })
+    setGroupTabSelfStyle({
+        groupColor: 'rgb(83, 100, 113)',
+        groupFontWeight: '500',
+        lineDisplay: 'none'
+    });
     // addPublishTipsIframe({ type: 'nft' })
 }
 
@@ -1812,12 +1817,30 @@ const addGroupTabEventListener = (params) => {
 
         refreshTabGroup();
 
-        window.addEventListener('scroll', addPageScrollEvent)
-        chrome.runtime.sendMessage({
-            actionType: "SWITCH_GROUP_BANNER_STATUS",
-            data: { type: 'btn' }
-        }, () => { });
+        window.addEventListener('scroll', addPageScrollEvent);
 
+        let tipsDom = document.querySelector('#denet_group_tip');
+        if(tipsDom) {
+            chrome.runtime.sendMessage({
+                actionType: "SWITCH_GROUP_BANNER_STATUS",
+                data: { type: 'btn' }
+            }, () => { });
+        } else {
+            onShowGroupBanner();
+        }
+    })
+}
+
+const onShowGroupBanner = () => {
+    chrome.runtime.onMessage.addListener((req, sender, sendResponse) => {
+        switch (req.actionType) {
+            case 'IFRAME_SHOW_GROUP_TIP':
+                chrome.runtime.sendMessage({
+                    actionType: "SWITCH_GROUP_BANNER_STATUS",
+                    data: { type: 'btn' }
+                }, () => { });
+                break
+        }
     })
 }