Skip to content

Commit

Permalink
refresh notifications upon "refresh" button click
Browse files Browse the repository at this point in the history
Problem:
Clicking on Refresh button present on UI top panel does not
refresh active notifications or toast messages.
Only success notifications gets hidden automatically after 10s,
error, info notifications remains active on UI even after refresh
webui.

Solution:
Clear all types of active toast messages upon refresh click.

Changes:
In refresh method, using querySelectorAll on document object
and for each toast currently active, call bvToast.hide to clear.

Change-Id: I47ba416a6b8e8e9872b4b4867abf96bbbef7c0f1
Signed-off-by: Shubhi Garg <[email protected]>
  • Loading branch information
shgarg26 committed Dec 10, 2024
1 parent c156729 commit 20ce44a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/layouts/AppLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ export default {
},
methods: {
refresh() {
// Clear all toast messages
document.querySelectorAll('.toast').forEach((toast) => {
const toastId = toast.id;
if (toastId) {
this.$bvToast.hide(toastId);
}
});
// Changing the component :key value will trigger
// a component re-rendering and 'refresh' the view
this.routerKey += 1;
Expand Down

0 comments on commit 20ce44a

Please sign in to comment.