diff --git a/src/addons/notifications/notifications.scss b/src/addons/notifications/notifications.scss index 305269884..4f4468bdf 100644 --- a/src/addons/notifications/notifications.scss +++ b/src/addons/notifications/notifications.scss @@ -34,13 +34,14 @@ img { width: var(--icon-size); height: var(--icon-size); + padding: 4px; } ion-icon { font-size: var(--icon-size); } padding: 0px; background: var(--background-color); - border-radius: var(--mdl-shape-borderRadius-xs); + border-radius: var(--core-avatar-radius); @include margin(6px, 8px, 6px, 0px); } diff --git a/src/addons/notifications/services/notifications.ts b/src/addons/notifications/services/notifications.ts index aeaf0660f..c25c81fa1 100644 --- a/src/addons/notifications/services/notifications.ts +++ b/src/addons/notifications/services/notifications.ts @@ -119,7 +119,7 @@ export class AddonNotificationsProvider { notification.notif = 1; notification.read = notification.timeread > 0; - if (typeof notification.customdata == 'string') { + if (typeof notification.customdata === 'string') { notification.customdata = CoreTextUtils.parseJSON>(notification.customdata, {}); } @@ -142,9 +142,6 @@ export class AddonNotificationsProvider { } } - const imgUrl = notification.customdata?.notificationpictureurl || notification.customdata?.notificationiconurl; - notification.imgUrl = imgUrl ? String(imgUrl) : undefined; - if (notification.useridfrom > 0) { // Try to get the profile picture of the user. try { @@ -155,6 +152,12 @@ export class AddonNotificationsProvider { } catch { // Error getting user. This can happen if device is offline or the user is deleted. } + } else { + // Do not assign avatar for newlogin notifications. + if (notification.eventtype !== 'newlogin') { + const imgUrl = notification.customdata?.notificationpictureurl || notification.customdata?.notificationiconurl; + notification.imgUrl = imgUrl ? String(imgUrl) : undefined; + } } return notification; diff --git a/src/core/components/user-avatar/user-avatar.scss b/src/core/components/user-avatar/user-avatar.scss index 4cc486a30..fa30ad311 100644 --- a/src/core/components/user-avatar/user-avatar.scss +++ b/src/core/components/user-avatar/user-avatar.scss @@ -79,6 +79,8 @@ font-weight: normal; width: calc(var(--core-avatar-size) - var(--userpicture-padding) - var(--userpicture-padding)); height: calc(var(--core-avatar-size) - var(--userpicture-padding) - var(--userpicture-padding)); + min-height: 0px; + min-width: 0px; font-size: calc(var(--core-avatar-size)*0.3); margin: var(--userpicture-padding);