From fc4c6973f37ade4989ec22fe9991b708bb2f74f0 Mon Sep 17 00:00:00 2001 From: Arunima George Date: Thu, 13 Mar 2025 15:59:47 +0000 Subject: [PATCH] TD-5170: Fixed console errors on Notifications page. --- .../Scripts/vuesrc/notification/notification.vue | 6 +++--- .../Scripts/vuesrc/notification/notifications.vue | 13 ++++++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/LearningHub.Nhs.WebUI/Scripts/vuesrc/notification/notification.vue b/LearningHub.Nhs.WebUI/Scripts/vuesrc/notification/notification.vue index 6c2a875c8..25ef12656 100644 --- a/LearningHub.Nhs.WebUI/Scripts/vuesrc/notification/notification.vue +++ b/LearningHub.Nhs.WebUI/Scripts/vuesrc/notification/notification.vue @@ -74,8 +74,8 @@   {{ notification.title }} - - + + @@ -173,7 +173,7 @@ .catch(e => console.log(e)); } }, - async deleteNotification() { + async deleteNotification() { await axios.delete( '/api/notification/' + this.selectedNotification.notificationId + '?userNotificationId=' + this.selectedNotification.id) .catch(e => console.log(e)); diff --git a/LearningHub.Nhs.WebUI/Scripts/vuesrc/notification/notifications.vue b/LearningHub.Nhs.WebUI/Scripts/vuesrc/notification/notifications.vue index 15229ade7..b21cb5698 100644 --- a/LearningHub.Nhs.WebUI/Scripts/vuesrc/notification/notifications.vue +++ b/LearningHub.Nhs.WebUI/Scripts/vuesrc/notification/notifications.vue @@ -87,7 +87,7 @@ @@ -143,6 +143,13 @@ $('#deleteModalButton').modal('hide'); $('#deleteModal').modal(); }, + closeConfirmation() { + if (document.activeElement instanceof HTMLElement) { + document.activeElement.blur(); + } + document.body.focus(); + setTimeout(() => { $('#deleteModal').modal('hide'); }, 10); + }, showNotification(notification: NotificationModel) { this.selectedNotification = notification; this.showMessage = true; @@ -155,7 +162,7 @@ }, async deleteNotification() { await this.getSelectedComponent().deleteNotification(); - $('#deleteModal').modal('hide'); + this.closeConfirmation(); this.showMessage = false; }, notificationTypeContent() {