Change handling of (token) errors due to #1706

This commit is contained in:
the-djmaze 2024-08-16 22:05:15 +02:00
parent 02ea6c4359
commit d00c953c88
25 changed files with 80 additions and 69 deletions

View file

@ -27,7 +27,7 @@ import {
getFolderFromCacheList
} from 'Common/Cache';
import { i18n, reloadTime } from 'Common/Translator';
import { i18n, reloadTime, getErrorMessage } from 'Common/Translator';
import { SettingsUserStore } from 'Stores/User/Settings';
import { NotificationUserStore } from 'Stores/User/Notification';
@ -150,7 +150,8 @@ export class AppUser extends AbstractApp {
logout() {
Remote.request('Logout', (iError, data) =>
iError ? alert(data) : rl.logoutReload(Settings.app('customLogoutLink'))
iError ? alert('Logout error: ' + getErrorMessage(iError, data))
: rl.logoutReload(Settings.app('customLogoutLink'))
);
}
@ -183,9 +184,9 @@ export class AppUser extends AbstractApp {
SettingsUserStore.init();
ContactUserStore.init();
loadFolders(value => {
loadFolders((success, error) => {
try {
if (value) {
if (success) {
startScreens([
MailBoxUserScreen,
SettingsUserScreen
@ -227,6 +228,7 @@ export class AppUser extends AbstractApp {
setTimeout(() => mailToHelper(SettingsGet('mailToEmail')), 500);
} else {
this.logout();
alert('Folders error: ' + getErrorMessage(0, error))
}
} catch (e) {
console.error(e);