Browse Source

open user info

nieyuge 2 năm trước cách đây
mục cha
commit
fbd501f851
1 tập tin đã thay đổi với 18 bổ sung3 xóa
  1. 18 3
      src/logic/background/twitter.js

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

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