diff --git a/src/background/httpClients.ts b/src/background/httpClients.ts index 0293a80d..d7a2b975 100644 --- a/src/background/httpClients.ts +++ b/src/background/httpClients.ts @@ -82,8 +82,8 @@ async function verifyPontoonRequestToken( ): Promise { if (token) { const storageKey = tokenStorageKey(token); - const tokenInfoValue: string | undefined = ( - await browser.storage.session.get(storageKey) + const tokenInfoValue = ( + (await browser.storage.session.get(storageKey)) as Record )[storageKey]; if (typeof tokenInfoValue === 'string') { const tokenInfo: TokenInfo = JSON.parse(tokenInfoValue); diff --git a/src/commons/options.ts b/src/commons/options.ts index 02feac95..757471f6 100644 --- a/src/commons/options.ts +++ b/src/commons/options.ts @@ -30,9 +30,9 @@ export async function getOptions( optionIds: ID[], ): Promise> { const defaultValues = defaultOptionsFor(browserFamily()); - const storageItems = await browser.storage.local.get( + const storageItems = (await browser.storage.local.get( optionIds.map((optionId) => storageKeyFor(optionId)), - ); + )) as Record>; const optionsWithDefaultValues: Partial> = {}; for (const optionId of optionIds) { const storageKey = storageKeyFor(optionId); diff --git a/src/commons/webExtensionsApi/index.ts b/src/commons/webExtensionsApi/index.ts index 62883c8f..c54ae196 100644 --- a/src/commons/webExtensionsApi/index.ts +++ b/src/commons/webExtensionsApi/index.ts @@ -313,6 +313,8 @@ export function listenToMessages< // no return to allow all listeners to react on the message action(typedMessade, sender); } + // always check check other actions if they are subscribed for this message + return undefined; }); } @@ -332,6 +334,7 @@ export function listenToMessagesAndRespond< // only one listener can send a response return action(typedMessade, sender); } else { + // let other actions check if they are subscribed for this message return undefined; } });