mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +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
|
|
@ -104,8 +104,8 @@ class AppUser extends AbstractApp {
|
||||||
if (rl.hash.check()) {
|
if (rl.hash.check()) {
|
||||||
this.reload();
|
this.reload();
|
||||||
}
|
}
|
||||||
Remote.jsVersion((iError, oData) => {
|
Remote.jsVersion(iError => {
|
||||||
if (!iError && oData && !oData.Result) {
|
if (100 < iError) {
|
||||||
this.reload();
|
this.reload();
|
||||||
}
|
}
|
||||||
}, Settings.app('version'));
|
}, Settings.app('version'));
|
||||||
|
|
@ -473,7 +473,7 @@ class AppUser extends AbstractApp {
|
||||||
AccountUserStore.loading(false);
|
AccountUserStore.loading(false);
|
||||||
IdentityUserStore.loading(false);
|
IdentityUserStore.loading(false);
|
||||||
|
|
||||||
if (!iError && oData.Result) {
|
if (!iError) {
|
||||||
const counts = {},
|
const counts = {},
|
||||||
sAccountEmail = AccountUserStore.email();
|
sAccountEmail = AccountUserStore.email();
|
||||||
let parentEmail = SettingsGet('ParentEmail') || sAccountEmail;
|
let parentEmail = SettingsGet('ParentEmail') || sAccountEmail;
|
||||||
|
|
@ -521,7 +521,7 @@ class AppUser extends AbstractApp {
|
||||||
Remote.templates((iError, data) => {
|
Remote.templates((iError, data) => {
|
||||||
TemplateUserStore.templates.loading(false);
|
TemplateUserStore.templates.loading(false);
|
||||||
|
|
||||||
if (!iError && data.Result && isArray(data.Result.Templates)) {
|
if (!iError && isArray(data.Result.Templates)) {
|
||||||
delegateRunOnDestroy(TemplateUserStore.templates());
|
delegateRunOnDestroy(TemplateUserStore.templates());
|
||||||
|
|
||||||
TemplateUserStore.templates(
|
TemplateUserStore.templates(
|
||||||
|
|
@ -537,8 +537,6 @@ class AppUser extends AbstractApp {
|
||||||
Remote.quota((iError, data) => {
|
Remote.quota((iError, data) => {
|
||||||
if (
|
if (
|
||||||
!iError &&
|
!iError &&
|
||||||
data &&
|
|
||||||
data.Result &&
|
|
||||||
isArray(data.Result) &&
|
isArray(data.Result) &&
|
||||||
1 < data.Result.length &&
|
1 < data.Result.length &&
|
||||||
isPosNumeric(data.Result[0], true) &&
|
isPosNumeric(data.Result[0], true) &&
|
||||||
|
|
@ -557,7 +555,7 @@ class AppUser extends AbstractApp {
|
||||||
if (folder && folder.trim()) {
|
if (folder && folder.trim()) {
|
||||||
Remote.folderInformation(
|
Remote.folderInformation(
|
||||||
(iError, data) => {
|
(iError, data) => {
|
||||||
if (!iError && data && data.Result && data.Result.Hash && data.Result.Folder) {
|
if (!iError && data.Result.Hash && data.Result.Folder) {
|
||||||
let uid = '',
|
let uid = '',
|
||||||
check = false,
|
check = false,
|
||||||
unreadCountChange = false;
|
unreadCountChange = false;
|
||||||
|
|
@ -636,7 +634,7 @@ class AppUser extends AbstractApp {
|
||||||
const folders = FolderUserStore.getNextFolderNames(refreshFolders);
|
const folders = FolderUserStore.getNextFolderNames(refreshFolders);
|
||||||
if (isNonEmptyArray(folders)) {
|
if (isNonEmptyArray(folders)) {
|
||||||
Remote.folderInformationMultiply((iError, oData) => {
|
Remote.folderInformationMultiply((iError, oData) => {
|
||||||
if (!iError && oData && oData.Result && oData.Result.List && isNonEmptyArray(oData.Result.List)) {
|
if (!iError && isNonEmptyArray(oData.Result.List)) {
|
||||||
const utc = Date.now();
|
const utc = Date.now();
|
||||||
oData.Result.List.forEach(item => {
|
oData.Result.List.forEach(item => {
|
||||||
const hash = getFolderHash(item.Folder),
|
const hash = getFolderHash(item.Folder),
|
||||||
|
|
@ -759,7 +757,7 @@ class AppUser extends AbstractApp {
|
||||||
*/
|
*/
|
||||||
getAutocomplete(query, autocompleteCallback) {
|
getAutocomplete(query, autocompleteCallback) {
|
||||||
Remote.suggestions((iError, data) => {
|
Remote.suggestions((iError, data) => {
|
||||||
if (!iError && data && isArray(data.Result)) {
|
if (!iError && isArray(data.Result)) {
|
||||||
autocompleteCallback(
|
autocompleteCallback(
|
||||||
data.Result.map(item => (item && item[0] ? new EmailModel(item[0], item[1]) : null)).filter(v => v)
|
data.Result.map(item => (item && item[0] ? new EmailModel(item[0], item[1]) : null)).filter(v => v)
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -68,8 +68,8 @@ export function defaultOptionsAfterRender(domItem, item) {
|
||||||
* @returns {mixed}
|
* @returns {mixed}
|
||||||
*/
|
*/
|
||||||
export function settingsSaveHelperSimpleFunction(koTrigger, context) {
|
export function settingsSaveHelperSimpleFunction(koTrigger, context) {
|
||||||
return (type, data) => {
|
return iError => {
|
||||||
koTrigger.call(context, data && data.Result ? SaveSettingsStep.TrueResult : SaveSettingsStep.FalseResult);
|
koTrigger.call(context, iError ? SaveSettingsStep.FalseResult : SaveSettingsStep.TrueResult);
|
||||||
setTimeout(() => koTrigger.call(context, SaveSettingsStep.Idle), 1000);
|
setTimeout(() => koTrigger.call(context, SaveSettingsStep.Idle), 1000);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,31 +10,23 @@ export class BrandingAdminSettings {
|
||||||
this.title = ko.observable(SettingsGet('Title')).idleTrigger();
|
this.title = ko.observable(SettingsGet('Title')).idleTrigger();
|
||||||
this.loadingDesc = ko.observable(SettingsGet('LoadingDescription')).idleTrigger();
|
this.loadingDesc = ko.observable(SettingsGet('LoadingDescription')).idleTrigger();
|
||||||
this.faviconUrl = ko.observable(SettingsGet('FaviconUrl')).idleTrigger();
|
this.faviconUrl = ko.observable(SettingsGet('FaviconUrl')).idleTrigger();
|
||||||
}
|
|
||||||
|
|
||||||
onBuild() {
|
this.title.subscribe(value =>
|
||||||
setTimeout(() => {
|
Remote.saveAdminConfig(settingsSaveHelperSimpleFunction(this.title.trigger, this), {
|
||||||
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(f1, {
|
|
||||||
'Title': value.trim()
|
'Title': value.trim()
|
||||||
});
|
})
|
||||||
});
|
);
|
||||||
|
|
||||||
this.loadingDesc.subscribe((value) => {
|
this.loadingDesc.subscribe(value =>
|
||||||
Remote.saveAdminConfig(f2, {
|
Remote.saveAdminConfig(settingsSaveHelperSimpleFunction(this.loadingDesc.trigger, this), {
|
||||||
'LoadingDescription': value.trim()
|
'LoadingDescription': value.trim()
|
||||||
});
|
})
|
||||||
});
|
);
|
||||||
|
|
||||||
this.faviconUrl.subscribe((value) => {
|
this.faviconUrl.subscribe(value =>
|
||||||
Remote.saveAdminConfig(f3, {
|
Remote.saveAdminConfig(settingsSaveHelperSimpleFunction(this.faviconUrl.trigger, this), {
|
||||||
'FaviconUrl': value.trim()
|
'FaviconUrl': value.trim()
|
||||||
});
|
})
|
||||||
});
|
);
|
||||||
}, 50);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,7 @@ export class ContactsAdminSettings {
|
||||||
this.testContactsError(false);
|
this.testContactsError(false);
|
||||||
this.testContactsErrorMessage('');
|
this.testContactsErrorMessage('');
|
||||||
|
|
||||||
if (!iError && data && data.Result && data.Result.Result) {
|
if (!iError && data.Result.Result) {
|
||||||
this.testContactsSuccess(true);
|
this.testContactsSuccess(true);
|
||||||
} else {
|
} else {
|
||||||
this.testContactsError(true);
|
this.testContactsError(true);
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ export class DomainsAdminSettings {
|
||||||
}
|
}
|
||||||
|
|
||||||
onDomainLoadRequest(iError, oData) {
|
onDomainLoadRequest(iError, oData) {
|
||||||
if (!iError && oData && oData.Result) {
|
if (!iError) {
|
||||||
showScreenPopup(DomainPopupView, [oData.Result]);
|
showScreenPopup(DomainPopupView, [oData.Result]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ export class PluginsAdminSettings {
|
||||||
}
|
}
|
||||||
|
|
||||||
onPluginLoadRequest(iError, data) {
|
onPluginLoadRequest(iError, data) {
|
||||||
if (!iError && data && data.Result) {
|
if (!iError) {
|
||||||
showScreenPopup(PluginPopupView, [data.Result]);
|
showScreenPopup(PluginPopupView, [data.Result]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,9 @@ export class SecurityAdminSettings {
|
||||||
}
|
}
|
||||||
|
|
||||||
onNewAdminPasswordResponse(iError, data) {
|
onNewAdminPasswordResponse(iError, data) {
|
||||||
if (!iError && data && data.Result) {
|
if (iError) {
|
||||||
|
this.adminPasswordUpdateError(true);
|
||||||
|
} else {
|
||||||
this.adminPassword('');
|
this.adminPassword('');
|
||||||
this.adminPasswordNew('');
|
this.adminPasswordNew('');
|
||||||
this.adminPasswordNew2('');
|
this.adminPasswordNew2('');
|
||||||
|
|
@ -138,8 +140,6 @@ export class SecurityAdminSettings {
|
||||||
this.adminPasswordUpdateSuccess(true);
|
this.adminPasswordUpdateSuccess(true);
|
||||||
|
|
||||||
this.weakPassword(!!data.Result.Weak);
|
this.weakPassword(!!data.Result.Weak);
|
||||||
} else {
|
|
||||||
this.adminPasswordUpdateError(true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ export class AccountsUserSettings {
|
||||||
this.accounts.remove((account) => accountToRemove === account);
|
this.accounts.remove((account) => accountToRemove === account);
|
||||||
|
|
||||||
Remote.accountDelete((iError, data) => {
|
Remote.accountDelete((iError, data) => {
|
||||||
if (!iError && data && data.Result && data.Reload) {
|
if (!iError && data.Reload) {
|
||||||
rl.route.root();
|
rl.route.root();
|
||||||
setTimeout(() => location.reload(), 1);
|
setTimeout(() => location.reload(), 1);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -43,11 +43,12 @@ export class SecurityUserSettings {
|
||||||
|
|
||||||
onBuild() {
|
onBuild() {
|
||||||
if (this.capaAutoLogout) {
|
if (this.capaAutoLogout) {
|
||||||
setTimeout(() => {
|
setTimeout(() =>
|
||||||
const f0 = settingsSaveHelperSimpleFunction(this.autoLogout.trigger, this);
|
this.autoLogout.subscribe(Remote.saveSettingsHelper(
|
||||||
|
'AutoLogout', pInt,
|
||||||
this.autoLogout.subscribe(Remote.saveSettingsHelper('AutoLogout', pInt, f0));
|
settingsSaveHelperSimpleFunction(this.autoLogout.trigger, this)
|
||||||
});
|
))
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ DomainAdminStore.fetch = () => {
|
||||||
DomainAdminStore.loading(true);
|
DomainAdminStore.loading(true);
|
||||||
Remote.domainList((iError, data) => {
|
Remote.domainList((iError, data) => {
|
||||||
DomainAdminStore.loading(false);
|
DomainAdminStore.loading(false);
|
||||||
if (!iError && data && data.Result) {
|
if (!iError) {
|
||||||
DomainAdminStore(
|
DomainAdminStore(
|
||||||
Object.entries(data.Result).map(([name, [enabled, alias]]) => ({
|
Object.entries(data.Result).map(([name, [enabled, alias]]) => ({
|
||||||
name: name,
|
name: name,
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ PackageAdminStore.fetch = () => {
|
||||||
PackageAdminStore.loading(true);
|
PackageAdminStore.loading(true);
|
||||||
Remote.packagesList((iError, data) => {
|
Remote.packagesList((iError, data) => {
|
||||||
PackageAdminStore.loading(false);
|
PackageAdminStore.loading(false);
|
||||||
if (!iError && data && data.Result) {
|
if (!iError) {
|
||||||
PackageAdminStore.real(!!data.Result.Real);
|
PackageAdminStore.real(!!data.Result.Real);
|
||||||
|
|
||||||
let list = [];
|
let list = [];
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ PluginAdminStore.fetch = () => {
|
||||||
PluginAdminStore.loading(true);
|
PluginAdminStore.loading(true);
|
||||||
Remote.pluginList((iError, data) => {
|
Remote.pluginList((iError, data) => {
|
||||||
PluginAdminStore.loading(false);
|
PluginAdminStore.loading(false);
|
||||||
if (!iError && data && data.Result) {
|
if (!iError) {
|
||||||
PluginAdminStore(
|
PluginAdminStore(
|
||||||
data.Result.map(item => ({
|
data.Result.map(item => ({
|
||||||
name: item.Name,
|
name: item.Name,
|
||||||
|
|
|
||||||
|
|
@ -605,7 +605,7 @@ class ComposePopupView extends AbstractViewPopup {
|
||||||
|
|
||||||
this.saving(false);
|
this.saving(false);
|
||||||
|
|
||||||
if (!iError && oData && oData.Result) {
|
if (!iError) {
|
||||||
if (oData.Result.NewFolder && oData.Result.NewUid) {
|
if (oData.Result.NewFolder && oData.Result.NewUid) {
|
||||||
result = true;
|
result = true;
|
||||||
|
|
||||||
|
|
@ -1032,7 +1032,7 @@ class ComposePopupView extends AbstractViewPopup {
|
||||||
const downloads = this.getAttachmentsDownloadsForUpload();
|
const downloads = this.getAttachmentsDownloadsForUpload();
|
||||||
if (isNonEmptyArray(downloads)) {
|
if (isNonEmptyArray(downloads)) {
|
||||||
Remote.messageUploadAttachments((iError, oData) => {
|
Remote.messageUploadAttachments((iError, oData) => {
|
||||||
if (!iError && oData && oData.Result) {
|
if (!iError) {
|
||||||
Object.entries(oData.Result).forEach(([tempName, id]) => {
|
Object.entries(oData.Result).forEach(([tempName, id]) => {
|
||||||
const attachment = this.getAttachmentById(id);
|
const attachment = this.getAttachmentById(id);
|
||||||
if (attachment) {
|
if (attachment) {
|
||||||
|
|
|
||||||
|
|
@ -225,8 +225,6 @@ class ContactsPopupView extends AbstractViewPopup {
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!iError &&
|
!iError &&
|
||||||
oData &&
|
|
||||||
oData.Result &&
|
|
||||||
oData.Result.RequestUid === requestUid &&
|
oData.Result.RequestUid === requestUid &&
|
||||||
0 < pInt(oData.Result.ResultID)
|
0 < pInt(oData.Result.ResultID)
|
||||||
) {
|
) {
|
||||||
|
|
@ -457,8 +455,7 @@ class ContactsPopupView extends AbstractViewPopup {
|
||||||
let count = 0,
|
let count = 0,
|
||||||
list = [];
|
list = [];
|
||||||
|
|
||||||
if (!iError && data && data.Result && data.Result.List) {
|
if (!iError && isNonEmptyArray(data.Result.List)) {
|
||||||
if (isNonEmptyArray(data.Result.List)) {
|
|
||||||
data.Result.List.forEach(item => {
|
data.Result.List.forEach(item => {
|
||||||
item = ContactModel.reviveFromJson(item);
|
item = ContactModel.reviveFromJson(item);
|
||||||
item && list.push(item);
|
item && list.push(item);
|
||||||
|
|
@ -467,7 +464,6 @@ class ContactsPopupView extends AbstractViewPopup {
|
||||||
count = pInt(data.Result.Count);
|
count = pInt(data.Result.Count);
|
||||||
count = 0 < count ? count : 0;
|
count = 0 < count ? count : 0;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
this.contactsCount(count);
|
this.contactsCount(count);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -206,7 +206,12 @@ class DomainPopupView extends AbstractViewPopup {
|
||||||
|
|
||||||
onTestConnectionResponse(iError, oData) {
|
onTestConnectionResponse(iError, oData) {
|
||||||
this.testing(false);
|
this.testing(false);
|
||||||
if (!iError && oData.Result) {
|
if (iError) {
|
||||||
|
this.testingImapError(true);
|
||||||
|
this.testingSieveError(true);
|
||||||
|
this.testingSmtpError(true);
|
||||||
|
this.sieveSettings(false);
|
||||||
|
} else {
|
||||||
let bImap = false,
|
let bImap = false,
|
||||||
bSieve = false;
|
bSieve = false;
|
||||||
|
|
||||||
|
|
@ -239,11 +244,6 @@ class DomainPopupView extends AbstractViewPopup {
|
||||||
} else if (bSieve && !bImap) {
|
} else if (bSieve && !bImap) {
|
||||||
this.sieveSettings(true);
|
this.sieveSettings(true);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
this.testingImapError(true);
|
|
||||||
this.testingSieveError(true);
|
|
||||||
this.testingSmtpError(true);
|
|
||||||
this.sieveSettings(false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,6 @@ class TemplatePopupView extends AbstractViewPopup {
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!iError &&
|
!iError &&
|
||||||
data &&
|
|
||||||
TemplateModel.validJson(data.Result) &&
|
TemplateModel.validJson(data.Result) &&
|
||||||
null != data.Result.Body
|
null != data.Result.Body
|
||||||
) {
|
) {
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ class TwoFactorConfigurationPopupView extends AbstractViewPopup {
|
||||||
|
|
||||||
this.capaTwoFactor = Settings.capa(Capa.TwoFactor);
|
this.capaTwoFactor = Settings.capa(Capa.TwoFactor);
|
||||||
|
|
||||||
|
const fn = iError => iError && this.viewEnable_(false);
|
||||||
this.addComputables({
|
this.addComputables({
|
||||||
viewEnable: {
|
viewEnable: {
|
||||||
read: this.viewEnable_,
|
read: this.viewEnable_,
|
||||||
|
|
@ -43,21 +44,12 @@ class TwoFactorConfigurationPopupView extends AbstractViewPopup {
|
||||||
value = !!value;
|
value = !!value;
|
||||||
if (value && this.twoFactorTested()) {
|
if (value && this.twoFactorTested()) {
|
||||||
this.viewEnable_(value);
|
this.viewEnable_(value);
|
||||||
Remote.enableTwoFactor((iError, data) => {
|
Remote.enableTwoFactor(fn, value);
|
||||||
if (iError || !data || !data.Result) {
|
|
||||||
this.viewEnable_(false);
|
|
||||||
}
|
|
||||||
}, true);
|
|
||||||
} else {
|
} else {
|
||||||
if (!value) {
|
if (!value) {
|
||||||
this.viewEnable_(value);
|
this.viewEnable_(value);
|
||||||
}
|
}
|
||||||
|
Remote.enableTwoFactor(fn, false);
|
||||||
Remote.enableTwoFactor((iError, data) => {
|
|
||||||
if (iError || !data || !data.Result) {
|
|
||||||
this.viewEnable_(false);
|
|
||||||
}
|
|
||||||
}, false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -152,7 +144,17 @@ class TwoFactorConfigurationPopupView extends AbstractViewPopup {
|
||||||
this.processing(false);
|
this.processing(false);
|
||||||
this.clearing(false);
|
this.clearing(false);
|
||||||
|
|
||||||
if (!iError && oData && oData.Result) {
|
if (iError) {
|
||||||
|
this.viewUser('');
|
||||||
|
this.viewEnable_(false);
|
||||||
|
this.twoFactorStatus(false);
|
||||||
|
this.twoFactorTested(false);
|
||||||
|
|
||||||
|
this.viewSecret('');
|
||||||
|
this.viewBackupCodes('');
|
||||||
|
this.viewUrlTitle('');
|
||||||
|
this.viewUrl('');
|
||||||
|
} else {
|
||||||
this.viewUser(pString(oData.Result.User));
|
this.viewUser(pString(oData.Result.User));
|
||||||
this.viewEnable_(!!oData.Result.Enable);
|
this.viewEnable_(!!oData.Result.Enable);
|
||||||
this.twoFactorStatus(!!oData.Result.IsSet);
|
this.twoFactorStatus(!!oData.Result.IsSet);
|
||||||
|
|
@ -163,30 +165,20 @@ class TwoFactorConfigurationPopupView extends AbstractViewPopup {
|
||||||
|
|
||||||
this.viewUrlTitle(pString(oData.Result.UrlTitle));
|
this.viewUrlTitle(pString(oData.Result.UrlTitle));
|
||||||
this.viewUrl(qr.toDataURL({ level: 'M', size: 8, value: this.getQr() }));
|
this.viewUrl(qr.toDataURL({ level: 'M', size: 8, value: this.getQr() }));
|
||||||
} else {
|
|
||||||
this.viewUser('');
|
|
||||||
this.viewEnable_(false);
|
|
||||||
this.twoFactorStatus(false);
|
|
||||||
this.twoFactorTested(false);
|
|
||||||
|
|
||||||
this.viewSecret('');
|
|
||||||
this.viewBackupCodes('');
|
|
||||||
this.viewUrlTitle('');
|
|
||||||
this.viewUrl('');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onShowSecretResult(iError, data) {
|
onShowSecretResult(iError, data) {
|
||||||
this.secreting(false);
|
this.secreting(false);
|
||||||
|
|
||||||
if (!iError && data && data.Result) {
|
if (iError) {
|
||||||
this.viewSecret(pString(data.Result.Secret));
|
|
||||||
this.viewUrlTitle(pString(data.Result.UrlTitle));
|
|
||||||
this.viewUrl(qr.toDataURL({ level: 'M', size: 6, value: this.getQr() }));
|
|
||||||
} else {
|
|
||||||
this.viewSecret('');
|
this.viewSecret('');
|
||||||
this.viewUrlTitle('');
|
this.viewUrlTitle('');
|
||||||
this.viewUrl('');
|
this.viewUrl('');
|
||||||
|
} else {
|
||||||
|
this.viewSecret(pString(data.Result.Secret));
|
||||||
|
this.viewUrlTitle(pString(data.Result.UrlTitle));
|
||||||
|
this.viewUrl(qr.toDataURL({ level: 'M', size: 6, value: this.getQr() }));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,9 @@ class TwoFactorTestPopupView extends AbstractViewPopup {
|
||||||
|
|
||||||
testCodeCommand() {
|
testCodeCommand() {
|
||||||
this.testing(true);
|
this.testing(true);
|
||||||
Remote.testTwoFactor((iError, data) => {
|
Remote.testTwoFactor(iError => {
|
||||||
this.testing(false);
|
this.testing(false);
|
||||||
this.codeStatus(!iError && data && !!data.Result);
|
this.codeStatus(!iError);
|
||||||
|
|
||||||
if (this.koTestedTrigger && this.codeStatus()) {
|
if (this.koTestedTrigger && this.codeStatus()) {
|
||||||
this.koTestedTrigger(true);
|
this.koTestedTrigger(true);
|
||||||
|
|
|
||||||
|
|
@ -850,8 +850,8 @@ export class MessageListMailBoxUserView extends AbstractViewRight {
|
||||||
addRequestedMessage(message.folder, message.uid);
|
addRequestedMessage(message.folder, message.uid);
|
||||||
|
|
||||||
Remote.message(
|
Remote.message(
|
||||||
(iError, data) => {
|
iError => {
|
||||||
const next = !!(!iError && data && data.Result);
|
const next = !iError;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.bPrefetch = false;
|
this.bPrefetch = false;
|
||||||
next && this.prefetchNextTick();
|
next && this.prefetchNextTick();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue