fix(ext): update message handlers
> If multiple listeners are registered for onMessage, > only the first listener to respond, reject, or throw > an error will affect the sender; all other listeners > will run, but their results will be ignored.
This commit is contained in:
@@ -7,7 +7,7 @@ export function handleTabControlMessage(
|
||||
message: { type: 'TAB_CONTROL'; action: TabAction; payload: any },
|
||||
sender: chrome.runtime.MessageSender,
|
||||
sendResponse: (response: unknown) => void
|
||||
): boolean {
|
||||
): true | undefined {
|
||||
const { action, payload } = message
|
||||
|
||||
switch (action as TabAction) {
|
||||
@@ -102,6 +102,6 @@ export function handleTabControlMessage(
|
||||
|
||||
default:
|
||||
sendResponse({ error: `Unknown action: ${action}` })
|
||||
return false
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user