mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-68788 core_notification: Check if the user is logged in
This commit is contained in:
parent
1afe68f382
commit
eff7ef2cd2
4 changed files with 11 additions and 6 deletions
2
lib/amd/build/notification.min.js
vendored
2
lib/amd/build/notification.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -292,8 +292,9 @@ export const exception = async ex => {
|
|||
*
|
||||
* @param {Number} contextId
|
||||
* @param {Array} notificationList
|
||||
* @param {Boolean} userLoggedIn
|
||||
*/
|
||||
export const init = (contextId, notificationList) => {
|
||||
export const init = (contextId, notificationList, userLoggedIn) => {
|
||||
currentContextId = contextId;
|
||||
|
||||
// Setup the message target region if it isn't setup already
|
||||
|
@ -302,8 +303,11 @@ export const init = (contextId, notificationList) => {
|
|||
// Add provided notifications.
|
||||
addNotifications(notificationList);
|
||||
|
||||
// Perform an initial poll for any new notifications.
|
||||
fetchNotifications();
|
||||
// If the user is not logged in then we can not fetch anything for them.
|
||||
if (userLoggedIn) {
|
||||
// Perform an initial poll for any new notifications.
|
||||
fetchNotifications();
|
||||
}
|
||||
};
|
||||
|
||||
// To maintain backwards compatability we export default here.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue