Ver V0.1.13 Add Automatic mailbox sync

This commit is contained in:
2026-10-06 23:29:18 +03:00
parent 20d1c21919
commit e50073ab4c
6 changed files with 260 additions and 28 deletions
+10
View File
@@ -118,6 +118,16 @@ async function syncMailbox(showToast, options = {}) {
}
if (window.daybreakMail) {
window.daybreakMail.onSyncUpdate(update => {
if (update.accountId !== connectedMailAccount?.id) return;
if (update.error) {
toast(update.error);
return;
}
if ((update.foldersChanged || []).includes(activeFolder)) {
syncMailbox(false, { offset: 0 });
}
});
$('#account-settings').addEventListener('click', openMailAccount);
$('#account-settings').addEventListener('keydown', event => {
if (event.key === 'Enter' || event.key === ' ') { event.preventDefault(); openMailAccount(); }