summary context menu delay fixed
This commit is contained in:
parent
084d289af0
commit
939c319f6f
1 changed files with 11 additions and 3 deletions
|
|
@ -1883,8 +1883,6 @@ async function processEmails(args) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (summarize) {
|
if (summarize) {
|
||||||
const tabs = await browser.tabs.query({ active: true, currentWindow: true });
|
|
||||||
const tabId = tabs[0].id;
|
|
||||||
let summarize_prefs = await browser.storage.sync.get({ summarize_display_mode: prefs_default.summarize_display_mode });
|
let summarize_prefs = await browser.storage.sync.get({ summarize_display_mode: prefs_default.summarize_display_mode });
|
||||||
|
|
||||||
// Collect messages into array to check count
|
// Collect messages into array to check count
|
||||||
|
|
@ -1893,9 +1891,19 @@ async function processEmails(args) {
|
||||||
messageArray.push(msg);
|
messageArray.push(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const tabs = await browser.tabs.query({ active: true, currentWindow: true });
|
||||||
|
const tabId = tabs[0].id;
|
||||||
|
|
||||||
// Inline mode for single message: generate inline summary in the message pane
|
// Inline mode for single message: generate inline summary in the message pane
|
||||||
if (summarize_prefs.summarize_display_mode === 'inline' && messageArray.length === 1) {
|
if (summarize_prefs.summarize_display_mode === 'inline' && messageArray.length === 1) {
|
||||||
await _generateSummaryForMessage(messageArray[0].headerMessageId, tabId);
|
// Fire the inline loading indicator immediately, before any heavy work
|
||||||
|
browser.tabs.sendMessage(tabId, { command: "showSummaryGenerating" });
|
||||||
|
|
||||||
|
const msg = messageArray[0];
|
||||||
|
const fullMessage = await browser.messages.getFull(msg.id);
|
||||||
|
await _generateSummaryForMessage(msg.headerMessageId, tabId, {
|
||||||
|
messageData: { message: msg, fullMessage }
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
// Webchat mode, or inline with multiple messages (fallback to webchat)
|
// Webchat mode, or inline with multiple messages (fallback to webchat)
|
||||||
const messageDataArray = [];
|
const messageDataArray = [];
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue