From 42c656035fdb9c76fcd5ed7e04f501d97acb6037 Mon Sep 17 00:00:00 2001
From: Yoshie Muranaka <yoshiemuranaka@gmail.com>
Date: Wed, 9 Sep 2020 09:55:59 -0700
Subject: Hide loader on Reboot BMC page

Added beforeRouteLeave component guard to make sure loader bar
is hidden before navigating to a new page. This will make sure
that the loading bar always starts from 0, if the user navigates
to another page before the inital load completes.

Signed-off-by: Yoshie Muranaka <yoshiemuranaka@gmail.com>
Change-Id: I16e57203123069160575f4c288bdbc5bad44e669
---
 src/views/Control/RebootBmc/RebootBmc.vue | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'src/views/Control/RebootBmc/RebootBmc.vue')

diff --git a/src/views/Control/RebootBmc/RebootBmc.vue b/src/views/Control/RebootBmc/RebootBmc.vue
index 7bd98770..0a4bafe6 100644
--- a/src/views/Control/RebootBmc/RebootBmc.vue
+++ b/src/views/Control/RebootBmc/RebootBmc.vue
@@ -54,6 +54,10 @@ export default {
       .dispatch('controls/getLastBmcRebootTime')
       .finally(() => this.endLoader());
   },
+  beforeRouteLeave(to, from, next) {
+    this.hideLoader();
+    next();
+  },
   methods: {
     onClick() {
       this.$bvModal
-- 
cgit v1.2.3

