forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-58452 ajax: do not show popup when can't retrieve the message count
- Loading branch information
1 parent
bd99cb9
commit fde2e5b
Showing
4 changed files
with
10 additions
and
6 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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. | ||
* | ||
|
@@ -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; | ||
}; | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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. | ||
* | ||
|
@@ -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; | ||
}; | ||
|