Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
martgil committed Jul 31, 2024
1 parent 8ad4a5e commit 183dfed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions extension/js/service_worker/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,8 @@ console.info('background.js service worker starting');
if (message === 'thunderbird_get_current_user') {
if (sender.tab?.id) {
const messageDetails = await messenger.messageDisplay.getDisplayedMessage(sender.tab?.id);
if (messageDetails) {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
return (await messenger.accounts.get(messageDetails.folder!.accountId)).name;
}
const accountId = messageDetails?.folder?.accountId || '';
return (await messenger.accounts.get(accountId))?.name;
}
}
return;
Expand Down
4 changes: 2 additions & 2 deletions extension/js/service_worker/bg-handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ export class BgHandlers {
const messageDetails = await messenger.messageDisplay.getDisplayedMessage(tabId);
if (messageDetails) {
const msgId = messageDetails.id;
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const acctEmail = (await messenger.accounts.get(messageDetails.folder!.accountId)).name;
const accountId = messageDetails?.folder?.accountId || '';
const acctEmail = (await messenger.accounts.get(accountId))?.name || '';
await handleClickEvent(tabId, acctEmail, msgId);
}
});
Expand Down

0 comments on commit 183dfed

Please sign in to comment.