This commit is contained in:
the-djmaze 2024-08-20 16:30:25 +02:00
parent 7ff5232554
commit 6a1b83b365
7 changed files with 15 additions and 9 deletions

View file

@ -1,7 +1,6 @@
import 'External/User/ko';
import { SMAudio } from 'Common/Audio';
import { pInt } from 'Common/Utils';
import { mailToHelper, setLayoutResizer, dropdownsDetectVisibility, loadAccountsAndIdentities } from 'Common/UtilsUser';
import {
@ -192,7 +191,7 @@ export class AppUser extends AbstractApp {
SettingsUserScreen
]);
setRefreshFoldersInterval(pInt(SettingsGet('CheckMailInterval')));
setRefreshFoldersInterval(SettingsGet('CheckMailInterval'));
loadAccountsAndIdentities();

View file

@ -1,7 +1,8 @@
import { RFC822 } from 'Common/File';
import { getFolderInboxName, getFolderFromCacheList } from 'Common/Cache';
import { baseCollator } from 'Common/Translator';
import { isArray, arrayLength } from 'Common/Utils';
import { SettingsGet } from 'Common/Globals';
import { isArray, arrayLength, pInt } from 'Common/Utils';
import { SettingsUserStore } from 'Stores/User/Settings';
import { FolderUserStore } from 'Stores/User/Folder';
import { MessagelistUserStore } from 'Stores/User/Messagelist';
@ -9,13 +10,13 @@ import { MessagelistUserStore } from 'Stores/User/Messagelist';
import Remote from 'Remote/User/Fetch';
let refreshInterval,
// Default every 5 minutes
refreshFoldersInterval = 300000;
// Default every 15 minutes
refreshFoldersInterval = 900000;
export const
setRefreshFoldersInterval = minutes => {
refreshFoldersInterval = Math.max(5, minutes) * 60000;
refreshFoldersInterval = Math.max(1, pInt(SettingsGet('minRefreshInterval')), pInt(minutes)) * 60000;
clearInterval(refreshInterval);
refreshInterval = setInterval(() => {
const cF = FolderUserStore.currentFolderFullName(),

View file

@ -39,6 +39,8 @@ export class UserSettingsGeneral extends AbstractViewSettings {
this.notificationSound = ko.observable(SettingsGet('NotificationSound'));
this.notificationSounds = ko.observableArray(SettingsGet('newMailSounds'));
this.minRefreshInterval = SettingsGet('minRefreshInterval');
this.desktopNotifications = NotificationUserStore.enabled;
this.isDesktopNotificationAllowed = NotificationUserStore.allowed;