Ver V0.1.13 Add Automatic mailbox sync
This commit is contained in:
+10
@@ -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(); }
|
||||
|
||||
Reference in New Issue
Block a user