Skip to content

Commit

Permalink
MDL-58452 ajax: do not show popup when can't retrieve the message count
Browse files Browse the repository at this point in the history
  • Loading branch information
marinaglancy committed Apr 7, 2017
1 parent bd99cb9 commit fde2e5b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion message/amd/build/message_repository.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions message/amd/src/message_repository.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @copyright 2016 Ryan Wyllie <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define(['jquery', 'core/ajax', 'core/notification'], function($, Ajax, Notification) {
define(['jquery', 'core/ajax', 'core/notification', 'core/log'], function($, Ajax, Notification, Log) {
/**
* Retrieve a list of messages from the server.
*
Expand Down Expand Up @@ -72,7 +72,9 @@ define(['jquery', 'core/ajax', 'core/notification'], function($, Ajax, Notificat

var promise = Ajax.call([request])[0];

promise.fail(Notification.exception);
promise.fail(function(e) {
Log.error('Could not retrieve unread message count: ' + e.message);
});

return promise;
};
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions message/output/popup/amd/src/notification_repository.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @copyright 2016 Ryan Wyllie <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define(['core/ajax', 'core/notification'], function(Ajax, Notification) {
define(['core/ajax', 'core/notification', 'core/log'], function(Ajax, Notification, Log) {
/**
* Retrieve a list of notifications from the server.
*
Expand Down Expand Up @@ -64,7 +64,9 @@ define(['core/ajax', 'core/notification'], function(Ajax, Notification) {

var promise = Ajax.call([request])[0];

promise.fail(Notification.exception);
promise.fail(function(e) {
Log.error('Could not retrieve notifications count: ' + e.message);
});

return promise;
};
Expand Down

0 comments on commit fde2e5b

Please sign in to comment.