Fix message lookup in details popup
This commit is contained in:
parent
ac2c017082
commit
6b741595cc
2 changed files with 3 additions and 3 deletions
|
@ -413,7 +413,7 @@ async function clearCacheForMessages(idsInput) {
|
|||
}
|
||||
} else if (msg?.type === "sortana:clearCacheForDisplayed") {
|
||||
try {
|
||||
const tabs = await browser.tabs.query({ active: true, currentWindow: true });
|
||||
const tabs = await browser.tabs.query({ active: true, lastFocusedWindow: true });
|
||||
const tabId = tabs[0]?.id;
|
||||
const msgs = tabId ? await browser.messageDisplay.getDisplayedMessages(tabId) : [];
|
||||
const ids = msgs.map(m => m.id);
|
||||
|
|
|
@ -11,13 +11,13 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|||
|
||||
if (!id) {
|
||||
try {
|
||||
const tabs = await browser.tabs.query({ active: true, currentWindow: true });
|
||||
const tabs = await browser.tabs.query({ active: true, lastFocusedWindow: true });
|
||||
const tabId = tabs[0]?.id;
|
||||
const msgs = tabId ? await browser.messageDisplay.getDisplayedMessages(tabId) : [];
|
||||
id = msgs[0]?.id;
|
||||
logger.aiLog('message id from displayed messages', { debug: true }, id);
|
||||
if (!id) {
|
||||
const mailTabs = await browser.mailTabs.query({ active: true, currentWindow: true });
|
||||
const mailTabs = await browser.mailTabs.query({ active: true, lastFocusedWindow: true });
|
||||
const mailTabId = mailTabs[0]?.id;
|
||||
const selected = mailTabId !== undefined ? await browser.mailTabs.getSelectedMessages(mailTabId) : null;
|
||||
id = selected?.messages?.[0]?.id;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue