(feat) show toast when compacting folder

pull/186/head
Ludovic Marcotte 2015-12-10 13:54:24 -05:00
parent 28399b698a
commit 96e93c0eeb
2 changed files with 9 additions and 7 deletions

View File

@ -627,8 +627,8 @@
error = [co expunge];
if (error)
{
response = [self responseWithStatus: 500];
[response appendContentString: @"Unable to expunge folder."];
response = [self responseWithStatus: 500
andJSONRepresentation: [NSDictionary dictionaryWithObject: @"Unable to expunge folder." forKey: @"message"]];
}
else
{

View File

@ -6,8 +6,8 @@
/**
* @ngInject
*/
MailboxesController.$inject = ['$state', '$timeout', '$mdDialog', '$mdMedia', '$mdSidenav', 'sgFocus', 'encodeUriFilter', 'Dialog', 'sgSettings', 'Account', 'Mailbox', 'VirtualMailbox', 'User', 'Preferences', 'stateAccounts'];
function MailboxesController($state, $timeout, $mdDialog, $mdMedia, $mdSidenav, focus, encodeUriFilter, Dialog, Settings, Account, Mailbox, VirtualMailbox, User, Preferences, stateAccounts) {
MailboxesController.$inject = ['$state', '$timeout', '$mdDialog', '$mdToast', '$mdMedia', '$mdSidenav', 'sgFocus', 'encodeUriFilter', 'Dialog', 'sgSettings', 'Account', 'Mailbox', 'VirtualMailbox', 'User', 'Preferences', 'stateAccounts'];
function MailboxesController($state, $timeout, $mdDialog, $mdToast, $mdMedia, $mdSidenav, focus, encodeUriFilter, Dialog, Settings, Account, Mailbox, VirtualMailbox, User, Preferences, stateAccounts) {
var vm = this,
account,
mailbox;
@ -238,9 +238,11 @@
function compactFolder(folder) {
folder.$compact().then(function() {
// Success
}, function(error) {
Dialog.alert(l('Warning'), error);
$mdToast.show(
$mdToast.simple()
.content(l('Folder compacted'))
.position('top right')
.hideDelay(3000));
});
}