@bobfrankston/rmfmail 1.1.192 → 1.1.193

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/client/app.ts CHANGED
@@ -436,6 +436,15 @@ initFolderTree(folderTree, (accountId, folderId, folderName, specialUse) => {
436
436
  markAsSeen();
437
437
  releaseFocus();
438
438
  loadMessages(accountId, folderId, 1, specialUse);
439
+ // Lazy-folder-sync: opening a folder fetches its latest from the server
440
+ // (fire-and-forget). The full all-folders sweep now runs only every 30
441
+ // min, so on-open sync is what keeps a folder you're actually looking at
442
+ // fresh. The folderSynced event refreshes the list when it lands. INBOX
443
+ // is excluded — IDLE + the 5-min quick check already keep it live, and
444
+ // re-syncing it on every visit is wasted work.
445
+ if (specialUse !== "inbox") {
446
+ import("./lib/api-client.js").then(m => m.syncFolderNow?.(accountId, folderId)).catch(() => { /* */ });
447
+ }
439
448
  setTitle(`${APP_NAME} - ${folderName}`);
440
449
  setNarrowFolderTitle(folderName);
441
450
  // Record the navigation in the active tab so a later tab-switch restores
@@ -1091,6 +1091,7 @@ __export(api_client_exports, {
1091
1091
  showReminderPopup: () => showReminderPopup,
1092
1092
  subscribeStore: () => subscribeStore,
1093
1093
  syncAccount: () => syncAccount,
1094
+ syncFolderNow: () => syncFolderNow,
1094
1095
  triggerSync: () => triggerSync,
1095
1096
  undeleteMessage: () => undeleteMessage,
1096
1097
  unsubscribeOneClick: () => unsubscribeOneClick,
@@ -1204,6 +1205,9 @@ function triggerSync() {
1204
1205
  function syncAccount(accountId) {
1205
1206
  return ipc().syncAccount(accountId);
1206
1207
  }
1208
+ function syncFolderNow(accountId, folderId) {
1209
+ return ipc().syncFolderNow?.(accountId, folderId);
1210
+ }
1207
1211
  function reauthenticate(accountId) {
1208
1212
  return ipc().reauthenticate(accountId);
1209
1213
  }