|
@@ -11,10 +11,9 @@ import {
|
|
|
setBadgeInfo,
|
|
|
hideBadge,
|
|
|
setMessageCount,
|
|
|
- getMessageInfo,
|
|
|
- readTaskAllMsg,
|
|
|
discordLoginCode,
|
|
|
- saveDiscordAuthWindowId
|
|
|
+ saveDiscordAuthWindowId,
|
|
|
+ onDisconnectHandler
|
|
|
} from "@/logic/background/twitter";
|
|
|
|
|
|
//加载bg.js 执行
|
|
@@ -22,15 +21,9 @@ setMessageCount();
|
|
|
|
|
|
// 消息通讯
|
|
|
chrome.runtime.onConnect.addListener(function (port) {
|
|
|
-
|
|
|
- if (port.name === "popup" || port.name === "popup_transactions") {
|
|
|
- let msgType = port.name === "popup" ? 1 : 2;
|
|
|
- port.onDisconnect.addListener(function() {
|
|
|
- readTaskAllMsg({msgType},() => {
|
|
|
- getMessageInfo();
|
|
|
- })
|
|
|
- });
|
|
|
- }
|
|
|
+ port.onDisconnect.addListener(function() {
|
|
|
+ onDisconnectHandler(port);
|
|
|
+ });
|
|
|
});
|
|
|
|
|
|
chrome.runtime.onInstalled.addListener(onInstalledMethod);
|