瀏覽代碼

[edit][bug]

zhangwei 2 年之前
父節點
當前提交
48b19e60f9
共有 1 個文件被更改,包括 10 次插入4 次删除
  1. 10 4
      src/logic/content/twitter.js

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

@@ -1,4 +1,4 @@
-import { getChromeStorage, setChromeStorage } from '@/uilts/chromeExtension.js'
+import { getChromeStorage, setChromeStorage, sendChromeTabMessage } from '@/uilts/chromeExtension.js'
 import { throttle, getQueryString, getCookie, nextTick, getQueryStringByUrl } from '@/uilts/help'
 import { discordAuthRedirectUri } from '@/http/configAPI'
 import { reportSrcPublishEvent } from '@/http/publishApi'
@@ -756,6 +756,12 @@ export function initExecuteScript(changes) {
             init()
         }
     }
+    if (changes.userInfo) {
+        let item = JSON.parse(changes.userInfo.newValue)
+        if (item) {
+            sendChromeTabMessage({ actionType: "FINISH_GROUP_BANNNER" }, () => { })
+        }
+    }
 }
 
 const createNFTIframe = ({ url, id }, callback) => {
@@ -1325,7 +1331,7 @@ export function publishNFTTweetEvent({ groupId, postId, srcContent }, callback)
             bindTwitterArt.needBind = true;
             bindTwitterArt.postId = postId;
             callback && callback()
-            
+
             jumpTwitterDetailByAlert()
             setTimeout(() => {
                 setGroupTabSelfStyle({
@@ -1456,11 +1462,11 @@ export const showBuyNFT = ({ nft_project_Id }) => {
     }
     let iframe = document.querySelector('#nftProjectId')
     iframe.style.display = 'block'
-    iframe.src = chrome.runtime.getURL(`/iframe/buy-nft.html?nftProjectId=${nft_project_Id}`)
+    iframe.src = chrome.runtime.getURL(`/iframe/buy-nft.html#/?nftProjectId=${nft_project_Id}`)
 }
 
 const initBuyNFT = () => {
-    let url = chrome.runtime.getURL(`/iframe/buy-nft.html`)
+    let url = ''
     let id = `nftProjectId`
     createNFTIframe({ url, id })
 }