mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 21:19:21 +03:00
Cleanup more iError && data.Result
This commit is contained in:
parent
87bee226b4
commit
ce74b2e92f
19 changed files with 78 additions and 100 deletions
|
|
@ -10,31 +10,23 @@ export class BrandingAdminSettings {
|
|||
this.title = ko.observable(SettingsGet('Title')).idleTrigger();
|
||||
this.loadingDesc = ko.observable(SettingsGet('LoadingDescription')).idleTrigger();
|
||||
this.faviconUrl = ko.observable(SettingsGet('FaviconUrl')).idleTrigger();
|
||||
}
|
||||
|
||||
onBuild() {
|
||||
setTimeout(() => {
|
||||
const f1 = settingsSaveHelperSimpleFunction(this.title.trigger, this),
|
||||
f2 = settingsSaveHelperSimpleFunction(this.loadingDesc.trigger, this),
|
||||
f3 = settingsSaveHelperSimpleFunction(this.faviconUrl.trigger, this);
|
||||
this.title.subscribe(value =>
|
||||
Remote.saveAdminConfig(settingsSaveHelperSimpleFunction(this.title.trigger, this), {
|
||||
'Title': value.trim()
|
||||
})
|
||||
);
|
||||
|
||||
this.title.subscribe((value) => {
|
||||
Remote.saveAdminConfig(f1, {
|
||||
'Title': value.trim()
|
||||
});
|
||||
});
|
||||
this.loadingDesc.subscribe(value =>
|
||||
Remote.saveAdminConfig(settingsSaveHelperSimpleFunction(this.loadingDesc.trigger, this), {
|
||||
'LoadingDescription': value.trim()
|
||||
})
|
||||
);
|
||||
|
||||
this.loadingDesc.subscribe((value) => {
|
||||
Remote.saveAdminConfig(f2, {
|
||||
'LoadingDescription': value.trim()
|
||||
});
|
||||
});
|
||||
|
||||
this.faviconUrl.subscribe((value) => {
|
||||
Remote.saveAdminConfig(f3, {
|
||||
'FaviconUrl': value.trim()
|
||||
});
|
||||
});
|
||||
}, 50);
|
||||
this.faviconUrl.subscribe(value =>
|
||||
Remote.saveAdminConfig(settingsSaveHelperSimpleFunction(this.faviconUrl.trigger, this), {
|
||||
'FaviconUrl': value.trim()
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ export class ContactsAdminSettings {
|
|||
this.testContactsError(false);
|
||||
this.testContactsErrorMessage('');
|
||||
|
||||
if (!iError && data && data.Result && data.Result.Result) {
|
||||
if (!iError && data.Result.Result) {
|
||||
this.testContactsSuccess(true);
|
||||
} else {
|
||||
this.testContactsError(true);
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ export class DomainsAdminSettings {
|
|||
}
|
||||
|
||||
onDomainLoadRequest(iError, oData) {
|
||||
if (!iError && oData && oData.Result) {
|
||||
if (!iError) {
|
||||
showScreenPopup(DomainPopupView, [oData.Result]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ export class PluginsAdminSettings {
|
|||
}
|
||||
|
||||
onPluginLoadRequest(iError, data) {
|
||||
if (!iError && data && data.Result) {
|
||||
if (!iError) {
|
||||
showScreenPopup(PluginPopupView, [data.Result]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -130,7 +130,9 @@ export class SecurityAdminSettings {
|
|||
}
|
||||
|
||||
onNewAdminPasswordResponse(iError, data) {
|
||||
if (!iError && data && data.Result) {
|
||||
if (iError) {
|
||||
this.adminPasswordUpdateError(true);
|
||||
} else {
|
||||
this.adminPassword('');
|
||||
this.adminPasswordNew('');
|
||||
this.adminPasswordNew2('');
|
||||
|
|
@ -138,8 +140,6 @@ export class SecurityAdminSettings {
|
|||
this.adminPasswordUpdateSuccess(true);
|
||||
|
||||
this.weakPassword(!!data.Result.Weak);
|
||||
} else {
|
||||
this.adminPasswordUpdateError(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ export class AccountsUserSettings {
|
|||
this.accounts.remove((account) => accountToRemove === account);
|
||||
|
||||
Remote.accountDelete((iError, data) => {
|
||||
if (!iError && data && data.Result && data.Reload) {
|
||||
if (!iError && data.Reload) {
|
||||
rl.route.root();
|
||||
setTimeout(() => location.reload(), 1);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -43,11 +43,12 @@ export class SecurityUserSettings {
|
|||
|
||||
onBuild() {
|
||||
if (this.capaAutoLogout) {
|
||||
setTimeout(() => {
|
||||
const f0 = settingsSaveHelperSimpleFunction(this.autoLogout.trigger, this);
|
||||
|
||||
this.autoLogout.subscribe(Remote.saveSettingsHelper('AutoLogout', pInt, f0));
|
||||
});
|
||||
setTimeout(() =>
|
||||
this.autoLogout.subscribe(Remote.saveSettingsHelper(
|
||||
'AutoLogout', pInt,
|
||||
settingsSaveHelperSimpleFunction(this.autoLogout.trigger, this)
|
||||
))
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue