zhangwei преди 2 години
родител
ревизия
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)
     }
 }