mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-07-15 12:58:04 +00:00
Lazy load startup task and email work
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
import spinnerModule from './spinner.js';
|
import spinnerModule from './spinner.js';
|
||||||
import sessionModule from './sessions.js';
|
import sessionModule from './sessions.js';
|
||||||
import { initEmailLibrary, openEmailLibrary, closeEmailLibrary, isOpen as isLibOpen, prewarmEmailLibrary } from './emailLibrary.js';
|
import { initEmailLibrary, openEmailLibrary, closeEmailLibrary, isOpen as isLibOpen } from './emailLibrary.js';
|
||||||
import * as Modals from './modalManager.js';
|
import * as Modals from './modalManager.js';
|
||||||
import { applyEdgeDock } from './modalSnap.js';
|
import { applyEdgeDock } from './modalSnap.js';
|
||||||
import { buildReplyAllCc } from './emailLibrary/replyRecipients.js';
|
import { buildReplyAllCc } from './emailLibrary/replyRecipients.js';
|
||||||
@@ -274,10 +274,11 @@ function _bindEvents() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initial unread count check, refresh every 60s
|
// Delay the lightweight unread badge check so opening Odysseus doesn't
|
||||||
_refreshUnreadCount();
|
// compete with the initial chat/session paint. The full email list now loads
|
||||||
|
// only when the inbox is actually opened.
|
||||||
|
setTimeout(_refreshUnreadCount, 8000);
|
||||||
setInterval(_refreshUnreadCount, 60000);
|
setInterval(_refreshUnreadCount, 60000);
|
||||||
prewarmEmailLibrary({ delay: 3000 });
|
|
||||||
|
|
||||||
// Deep-link: #email=<folder>:<uid> opens the library and expands that card
|
// Deep-link: #email=<folder>:<uid> opens the library and expands that card
|
||||||
_maybeOpenFromHash();
|
_maybeOpenFromHash();
|
||||||
|
|||||||
+1
-3
@@ -2706,6 +2706,7 @@ function _renderMainView() {
|
|||||||
// ---- Modal ----
|
// ---- Modal ----
|
||||||
|
|
||||||
export function openTasks(focusId, opts) {
|
export function openTasks(focusId, opts) {
|
||||||
|
startNotificationPolling();
|
||||||
const o = opts || {};
|
const o = opts || {};
|
||||||
const openActivityForFailure = _taskFailurePending && !focusId && o.filter === undefined;
|
const openActivityForFailure = _taskFailurePending && !focusId && o.filter === undefined;
|
||||||
_setTaskFailurePending(false);
|
_setTaskFailurePending(false);
|
||||||
@@ -2937,9 +2938,6 @@ function stopNotificationPolling() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start polling on module load
|
|
||||||
startNotificationPolling();
|
|
||||||
|
|
||||||
const tasksModule = { openTasks, closeTasks, isTasksOpen, startNotificationPolling, stopNotificationPolling };
|
const tasksModule = { openTasks, closeTasks, isTasksOpen, startNotificationPolling, stopNotificationPolling };
|
||||||
export default tasksModule;
|
export default tasksModule;
|
||||||
window.tasksModule = tasksModule;
|
window.tasksModule = tasksModule;
|
||||||
|
|||||||
Reference in New Issue
Block a user