From aa04ff3742e53bff9f5369ab7357050b7c2947a3 Mon Sep 17 00:00:00 2001 From: Patrick Maia Date: Wed, 1 Oct 2014 16:43:29 -0300 Subject: #53 - gives better feedback on UI when attempt to add invalid tag is made --- web-ui/app/js/services/mail_service.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'web-ui/app/js/services/mail_service.js') diff --git a/web-ui/app/js/services/mail_service.js b/web-ui/app/js/services/mail_service.js index d9090ee7..35e6a39b 100644 --- a/web-ui/app/js/services/mail_service.js +++ b/web-ui/app/js/services/mail_service.js @@ -60,7 +60,13 @@ define( that.refreshResults(); $(document).trigger(events.mail.tags.updated, { ident: ident, tags: data }); }) - .fail(this.errorMessage(i18n('Could not update mail tags'))); + .fail(function (resp) { + var msg = i18n('Could not update mail tags'); + if(resp.status == 403) { + msg = i18n('Invalid tag name'); + } + that.trigger(document, events.ui.userAlerts.displayMessage, { message: msg }); + }); }; this.readMail = function (ev, data) { -- cgit v1.2.3