|
@@ -116,6 +116,10 @@ chrome.runtime.onMessage.addListener((req, sender, sendResponse) => {
|
|
|
state.show_btn = true
|
|
|
state.status = 'iframe'
|
|
|
state.iframe_url = req.data.iframe_url
|
|
|
+ nftAuthINfo.value = req.data.nftAuthINfo
|
|
|
+ state.showMask = req.data.showMask
|
|
|
+ state.detail = req.data.detail
|
|
|
+ state.postId = req.data.postId
|
|
|
}
|
|
|
break
|
|
|
}
|
|
@@ -294,13 +298,24 @@ const clickCancel = () => {
|
|
|
}
|
|
|
|
|
|
const clickFixed = () => {
|
|
|
- state.handle_type = '固定右上角'
|
|
|
- getChromeStorage('fullCheck', (res) => {
|
|
|
- if (res && res.fullCheck) {
|
|
|
- // 固定
|
|
|
- handleFixed()
|
|
|
+ getChromeStorage('userInfo', (_userInfo) => {
|
|
|
+ if (!_userInfo) {
|
|
|
+ chrome.runtime.sendMessage(
|
|
|
+ { actionType: "POPUP_LOGIN", data: "" },
|
|
|
+ (response) => {
|
|
|
+ console.log("res", response);
|
|
|
+ }
|
|
|
+ )
|
|
|
} else {
|
|
|
- state.show_alert = true
|
|
|
+ state.handle_type = '固定右上角'
|
|
|
+ getChromeStorage('fullCheck', (res) => {
|
|
|
+ if (res && res.fullCheck) {
|
|
|
+ // 固定
|
|
|
+ handleFixed()
|
|
|
+ } else {
|
|
|
+ state.show_alert = true
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -310,23 +325,34 @@ const handleFull = () => {
|
|
|
if (state.status != 'iframe' || !state.iframe_url) {
|
|
|
return
|
|
|
}
|
|
|
- // 切换状态
|
|
|
- state.status = '固定右上角'
|
|
|
- state.show_btn = false
|
|
|
- sendChromeTabMessage({
|
|
|
- actionType: 'Set_ToolBox_Fixed',
|
|
|
- data: {
|
|
|
- type: '全屏',
|
|
|
- iframe_url: state.iframe_url,
|
|
|
- tweetId: state.tweetId,
|
|
|
- nftAuthINfo: nftAuthINfo.value,
|
|
|
- showMask: state.showMask,
|
|
|
- detail: state.detail,
|
|
|
- postId: state.postId,
|
|
|
+ getChromeStorage('userInfo', (_userInfo) => {
|
|
|
+ if (!_userInfo) {
|
|
|
+ chrome.runtime.sendMessage(
|
|
|
+ { actionType: "POPUP_LOGIN", data: "" },
|
|
|
+ (response) => {
|
|
|
+ console.log("res", response);
|
|
|
+ }
|
|
|
+ )
|
|
|
+ } else {
|
|
|
+ // 切换状态
|
|
|
+ state.status = '固定右上角'
|
|
|
+ state.show_btn = false
|
|
|
+ sendChromeTabMessage({
|
|
|
+ actionType: 'Set_ToolBox_Fixed',
|
|
|
+ data: {
|
|
|
+ type: '全屏',
|
|
|
+ iframe_url: state.iframe_url,
|
|
|
+ tweetId: state.tweetId,
|
|
|
+ nftAuthINfo: nftAuthINfo.value,
|
|
|
+ showMask: state.showMask,
|
|
|
+ detail: state.detail,
|
|
|
+ postId: state.postId,
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // 清除当前iframe src
|
|
|
+ state.iframe_url = ''
|
|
|
}
|
|
|
})
|
|
|
- // 清除当前iframe src
|
|
|
- state.iframe_url = ''
|
|
|
}
|
|
|
|
|
|
// 全屏
|