zhangwei 2 лет назад
Родитель
Сommit
e7c465ca6e
1 измененных файлов с 9 добавлено и 5 удалено
  1. 9 5
      src/logic/content/twitter.js

+ 9 - 5
src/logic/content/twitter.js

@@ -1602,11 +1602,15 @@ const TwitterApiCreateTweet = ({ text, tweet_Id }) => {
 }
 
 const sendChromeMessage = (done, tweet_Id, response) => {
-    console.log('sendChromeMessage', done)
-    if (done == '是') {
-        chrome.runtime.sendMessage({ actionType: "DO_TASK", do_type: 'api', tweet_Id, task_type: 'createTweet1', task_data: '', task_done: '是', response })
-    } else {
-        chrome.runtime.sendMessage({ actionType: "DO_TASK", do_type: 'api', tweet_Id, task_type: 'createTweet1', task_data: '', task_done: '否' })
+    try {
+        console.log('sendChromeMessage', done)
+        if (done == '是') {
+            chrome.runtime.sendMessage({ actionType: "DO_TASK", do_type: 'api', tweet_Id, task_type: 'createTweet1', task_data: '', task_done: '是', response })
+        } else {
+            chrome.runtime.sendMessage({ actionType: "DO_TASK", do_type: 'api', tweet_Id, task_type: 'createTweet1', task_data: '', task_done: '否' })
+        }
+    } catch (error) {
+        console.error('catch', error)
     }
 }