diff options
author | Shubhi Garg <shgarg@nvidia.com> | 2024-12-02 12:26:48 +0300 |
---|---|---|
committer | shgarg <shgarg@nvidia.com> | 2024-12-10 09:45:17 +0300 |
commit | 20ce44a5e423d0b80080de6a1afaa63ba7bc9d20 (patch) | |
tree | e66ad6dedf75ceb8c8acd6607a634f99143f9a35 | |
parent | c15672993166fd670ed832eb8da83c36537530c4 (diff) | |
download | webui-vue-master.tar.xz |
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 <shgarg@nvidia.com>
-rw-r--r-- | src/layouts/AppLayout.vue | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/layouts/AppLayout.vue b/src/layouts/AppLayout.vue index 4f242632..4f468480 100644 --- a/src/layouts/AppLayout.vue +++ b/src/layouts/AppLayout.vue @@ -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; |