mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 21:19:21 +03:00
Code refactoring (promises for folders management)
This commit is contained in:
parent
9bec1d0a8f
commit
bab64a7cea
19 changed files with 467 additions and 333 deletions
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
FolderStore = require('Stores/User/Folder'),
|
||||
|
||||
Remote = require('Remote/User/Ajax'),
|
||||
Promises = require('Promises/User/Ajax'),
|
||||
|
||||
kn = require('Knoin/Knoin'),
|
||||
AbstractView = require('Knoin/AbstractView')
|
||||
|
|
@ -76,21 +76,9 @@
|
|||
sParentFolderName = FolderStore.namespace.substr(0, FolderStore.namespace.length - 1);
|
||||
}
|
||||
|
||||
FolderStore.foldersCreating(true);
|
||||
Remote.folderCreate(function (sResult, oData) {
|
||||
|
||||
FolderStore.foldersCreating(false);
|
||||
if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
|
||||
{
|
||||
require('App/User').folders();
|
||||
}
|
||||
else
|
||||
{
|
||||
FolderStore.folderList.error(
|
||||
oData && oData.ErrorCode ? Translator.getNotification(oData.ErrorCode) : Translator.i18n('NOTIFICATIONS/CANT_CREATE_FOLDER'));
|
||||
}
|
||||
|
||||
}, this.folderName(), sParentFolderName);
|
||||
require('App/User').foldersPromisesActionHelper(
|
||||
Promises.folderCreate(this.folderName(), sParentFolderName, FolderStore.foldersCreating),
|
||||
Enums.Notification.CantCreateFolder);
|
||||
|
||||
this.cancelCommand();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue