mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 12:09:20 +03:00
Improve SettingsUserStore handling
This commit is contained in:
parent
ce74b2e92f
commit
97d5f8762d
8 changed files with 49 additions and 96 deletions
|
|
@ -19,7 +19,7 @@ export class SecurityUserSettings {
|
|||
this.capaTwoFactor = Settings.capa(Capa.TwoFactor);
|
||||
|
||||
this.autoLogout = SettingsUserStore.autoLogout;
|
||||
this.autoLogout.trigger = ko.observable(SaveSettingsStep.Idle);
|
||||
this.autoLogoutTrigger = ko.observable(SaveSettingsStep.Idle);
|
||||
|
||||
let i18nLogout = (key, params) => i18n('SETTINGS_SECURITY/AUTOLOGIN_' + key, params);
|
||||
this.autoLogoutOptions = ko.computed(() => {
|
||||
|
|
@ -35,20 +35,16 @@ export class SecurityUserSettings {
|
|||
{ 'id': 60 * 10, 'name': i18nLogout('HOURS_OPTION_NAME', { 'HOURS': 10 }) }
|
||||
];
|
||||
});
|
||||
|
||||
if (this.capaAutoLogout) {
|
||||
this.autoLogout.subscribe(value => Remote.saveSetting(
|
||||
'AutoLogout', pInt(value),
|
||||
settingsSaveHelperSimpleFunction(this.autoLogoutTrigger, this)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
configureTwoFactor() {
|
||||
showScreenPopup(TwoFactorConfigurationPopupView);
|
||||
}
|
||||
|
||||
onBuild() {
|
||||
if (this.capaAutoLogout) {
|
||||
setTimeout(() =>
|
||||
this.autoLogout.subscribe(Remote.saveSettingsHelper(
|
||||
'AutoLogout', pInt,
|
||||
settingsSaveHelperSimpleFunction(this.autoLogout.trigger, this)
|
||||
))
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue