From ee569d625c448a195cb4f8f759c755d187979b59 Mon Sep 17 00:00:00 2001
From: Vitalii Lysak <v.lysak@dunice.net>
Date: Thu, 8 Sep 2022 12:22:06 +0300
Subject: SILABMC-304: fx time upd after redirect from another page

---
 src/views/_sila/Overview/DateTime/DateTime.vue | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

(limited to 'src/views/_sila/Overview/DateTime/DateTime.vue')

diff --git a/src/views/_sila/Overview/DateTime/DateTime.vue b/src/views/_sila/Overview/DateTime/DateTime.vue
index e4bc89b7..3beec1e8 100644
--- a/src/views/_sila/Overview/DateTime/DateTime.vue
+++ b/src/views/_sila/Overview/DateTime/DateTime.vue
@@ -324,24 +324,20 @@ export default {
   },
   watch: {
     ntpServers() {
-      this.setNtpValues();
+      this.getNtpValues();
     },
     manualDate() {
       this.emitChange();
     },
     bmcTime() {
-      this.form.manual.date = this.$options.filters.formatDate(
-        this.$store.getters['global/bmcTime']
-      );
-      this.form.manual.time = this.$options.filters
-        .formatTime(this.$store.getters['global/bmcTime'])
-        .slice(0, 5);
+      this.getBmcTime();
     },
   },
   created() {
     this.startLoader();
     this.$store.dispatch('dateTime/getNtpData').finally(() => {
-      this.setNtpValues();
+      this.getNtpValues();
+      this.getBmcTime();
       this.endLoader();
       this.isBusy = false;
     });
@@ -354,7 +350,7 @@ export default {
         manualDate: this.manualDate ? new Date(this.manualDate) : null,
       });
     },
-    setNtpValues() {
+    getNtpValues() {
       this.form.configurationSelected = this.isNtpProtocolEnabled
         ? 'ntp'
         : 'manual';
@@ -364,6 +360,14 @@ export default {
         this.form.ntp.thirdAddress = '',
       ] = [this.ntpServers[0], this.ntpServers[1], this.ntpServers[2]];
     },
+    getBmcTime() {
+      this.form.manual.date = this.$options.filters.formatDate(
+        this.$store.getters['global/bmcTime']
+      );
+      this.form.manual.time = this.$options.filters
+        .formatTime(this.$store.getters['global/bmcTime'])
+        .slice(0, 5);
+    },
     submitForm() {
       this.$v.$touch();
       if (this.$v.$invalid) return;
-- 
cgit v1.2.3

