|
@@ -56,6 +56,8 @@ import { pageUrl } from "@/http/configAPI.js"
|
|
|
import Report from "@/log-center/log"
|
|
|
import { prepareStart, treasureStart } from '@/http/treasure.js'
|
|
|
import { getChromeCookie, removeChromeCookie } from '@/uilts/chromeExtension.js'
|
|
|
+let state = inject('state')
|
|
|
+state.btn_loading = false
|
|
|
|
|
|
state.log_show = {
|
|
|
pageSource: Report.pageSource.pending_page,
|
|
@@ -83,10 +85,18 @@ chrome.storage.onChanged.addListener(changes => {
|
|
|
chrome.runtime.onMessage.addListener((req, sender, sendResponse) => {
|
|
|
switch (req.actionType) {
|
|
|
case 'DO_TASK':
|
|
|
- if (!req.task_type || state.tweetId != req.tweet_Id || !req.task_done) {
|
|
|
+ if (!req.task_type || state.tweetId != req.tweet_Id) {
|
|
|
return
|
|
|
}
|
|
|
- if (req.task_type == 'createTweet') {
|
|
|
+ if (!req.task_done && req.task_type == 'createTweet') {
|
|
|
+
|
|
|
+ state.toast.txt = 'Seems something went wrong, please try again'
|
|
|
+ state.toast.show = true
|
|
|
+ state.toast.has_icon = false
|
|
|
+ setTimeout(() => {
|
|
|
+ state.toast.show = false
|
|
|
+ }, 2000)
|
|
|
+ } else if (req.task_type == 'createTweet' && req.task_done) {
|
|
|
treasureStart({
|
|
|
params: {
|
|
|
postId: state.postId || '',
|
|
@@ -104,8 +114,7 @@ chrome.runtime.onMessage.addListener((req, sender, sendResponse) => {
|
|
|
}
|
|
|
})
|
|
|
|
|
|
-let state = inject('state')
|
|
|
-state.btn_loading = false
|
|
|
+
|
|
|
|
|
|
const clickBtn = () => {
|
|
|
if (state.cover_status == '奖励已被领光') {
|