diff --git a/src/background/background.ts b/src/background/background.ts index ae06270..bcda98a 100644 --- a/src/background/background.ts +++ b/src/background/background.ts @@ -9,15 +9,17 @@ export async function parseData( { status, to, from }: RuntimeMessage, sender?: chrome.runtime.MessageSender, ) { + if (to !== "background") { + return; + } + let tabId: number | undefined; if (sender && sender.tab && sender.tab.id) { tabId = sender.tab.id; } + log.info(status); - if (to !== "background") { - return; - } switch (status.code) { case "ready": switch (from) { diff --git a/src/components/pages/Home.svelte b/src/components/pages/Home.svelte index 6cd4e66..1d81056 100644 --- a/src/components/pages/Home.svelte +++ b/src/components/pages/Home.svelte @@ -265,12 +265,12 @@ } async function parseData({ status, to }: RuntimeMessage) { - setStatus("..."); - if (to !== "option") { return; } + setStatus("..."); + log.info(status); setStatus("msg" in status ? status.msg : status.code); diff --git a/src/content/client.ts b/src/content/client.ts index 8b6a18e..938001f 100644 --- a/src/content/client.ts +++ b/src/content/client.ts @@ -271,7 +271,7 @@ export async function readySignalSend() { await runtime.send({ to: "option", status: { - msg: "Ready for accept request", + msg: "Ready for accept request?", code: "ready", }, }); @@ -281,7 +281,7 @@ async function acceptSignalSend() { await runtime.send({ to: "option", status: { - msg: "Ready for accept request", + msg: "Accepting request...", code: "accept", }, }); @@ -396,12 +396,12 @@ async function unSubSubNow(channelID: string) { } export async function parseData({ status, to: type }: RuntimeMessage) { - log.info(status); - if (type !== "content") { return; } + log.info(status); + switch (status.code) { case "loading": isRunning = true;