nieyuge 2 سال پیش
والد
کامیت
0b8f46dbe5
1فایلهای تغییر یافته به همراه18 افزوده شده و 3 حذف شده
  1. 18 3
      src/logic/background/twitter.js

+ 18 - 3
src/logic/background/twitter.js

@@ -256,9 +256,24 @@ export function onInstalledCreateTab() {
             });
             removeChromeCookie(cookiesParams)
         } else {
-            chrome.tabs.create({
-                url: "https://twitter.com",
-            });
+            let nftParams = {
+                name: 'nft_info',
+                url: pageUrl
+            }
+            getChromeCookie(nftParams, (res) => {
+                let { twitterAccount, nftProjectId } = res;
+                if (res && twitterAccount && nftProjectId) {
+                    let url = `https://twitter.com/${twitterAccount}`
+                    chrome.tabs.create({
+                        url
+                    });
+                    removeChromeCookie(nftParams)
+                } else {
+                    chrome.tabs.create({
+                        url: "https://twitter.com",
+                    });
+                }
+            })
         }
     })
 }