Fix Javascript error on create/delete folder (#1079)

This commit is contained in:
RainLoop Team 2016-06-20 20:22:51 +03:00
parent 9a1d5dd1d3
commit c71ecbc12d
4 changed files with 18 additions and 17 deletions

View file

@ -436,11 +436,12 @@ class AppUser extends AbstractApp
.abort('Folders')
.fastResolve(true)
.then(() => promise)
.catch((errorCode) => {
FolderStore.folderList.error(getNotification(errorCode, '', errorDefCode));
}).fin(() => {
.then(() => {
Promises.foldersReloadWithTimeout(FolderStore.foldersLoading);
}).done()
}, (errorCode) => {
FolderStore.folderList.error(getNotification(errorCode, '', errorDefCode));
Promises.foldersReloadWithTimeout(FolderStore.foldersLoading);
})
;
}

View file

@ -1564,7 +1564,11 @@ export function changeTheme(value, themeTrigger)
let
themeLink = $('#app-theme-link'),
themeStyle = $('#app-theme-style'),
url = themeLink.attr('href')
url = themeLink.attr('href'),
clearTimer = () => {
__themeTimer = window.setTimeout(() => themeTrigger(SaveSettingsStep.Idle), 1000);
__themeAjax = null;
}
;
if (!url)
@ -1594,7 +1598,7 @@ export function changeTheme(value, themeTrigger)
__themeAjax = $.ajax({
url: url,
dataType: 'json'
}).done((data) => {
}).then((data) => {
if (data && isArray(data) && 2 === data.length)
{
@ -1616,14 +1620,7 @@ export function changeTheme(value, themeTrigger)
themeTrigger(SaveSettingsStep.TrueResult);
}
}).always(() => {
__themeTimer = window.setTimeout(() => {
themeTrigger(SaveSettingsStep.Idle);
}, 1000);
__themeAjax = null;
});
}).then(clearTimer, clearTimer);
}
}

View file

@ -75,7 +75,8 @@
require('App/User').default.foldersPromisesActionHelper(
Promises.folderRename(oFolder.fullNameRaw, sEditName, FolderStore.foldersRenaming),
Enums.Notification.CantRenameFolder);
Enums.Notification.CantRenameFolder
);
Cache.removeFolderFromCacheList(oFolder.fullNameRaw);
@ -155,7 +156,8 @@
require('App/User').default.foldersPromisesActionHelper(
Promises.folderDelete(oFolderToRemove.fullNameRaw, FolderStore.foldersDeleting),
Enums.Notification.CantDeleteFolder);
Enums.Notification.CantDeleteFolder
);
Cache.removeFolderFromCacheList(oFolderToRemove.fullNameRaw);
}

View file

@ -73,7 +73,8 @@
require('App/User').default.foldersPromisesActionHelper(
Promises.folderCreate(this.folderName(), sParentFolderName, FolderStore.foldersCreating),
Enums.Notification.CantCreateFolder);
Enums.Notification.CantCreateFolder
);
this.cancelCommand();