From 2c2d8d6b56e7ee49d81196c26e04a7f243821852 Mon Sep 17 00:00:00 2001 From: Nikhil Date: Thu, 30 Apr 2020 10:47:49 -0700 Subject: [PATCH] [Notebook]: Unnecessary notification "Time bounds changed to fixed timespan mode" #2843 (#2866) * [Notebook]: Unnecessary notification "Time bounds changed to fixed timespan mode" #2843 * removed stopclock call. Co-authored-by: Andrew Henry Co-authored-by: Deep Tailor --- .../notebook/components/notebook-embed.vue | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/plugins/notebook/components/notebook-embed.vue b/src/plugins/notebook/components/notebook-embed.vue index a721a31c07..4a82bc7632 100644 --- a/src/plugins/notebook/components/notebook-embed.vue +++ b/src/plugins/notebook/components/notebook-embed.vue @@ -162,19 +162,31 @@ export default { }).show(this.embed.snapshot.src); }, changeLocation() { - this.openmct.time.stopClock(); - this.openmct.time.bounds({ - start: this.embed.bounds.start, - end: this.embed.bounds.end - }); - const link = this.embed.historicLink; if (!link) { return; } + const bounds = this.openmct.time.bounds(); + const isTimeBoundChanged = this.embed.bounds.start !== bounds.start + && this.embed.bounds.end !== bounds.end; + const isFixedTimespanMode = !this.openmct.time.clock(); + window.location.href = link; - const message = 'Time bounds changed to fixed timespan mode'; + + let message = ''; + if (isTimeBoundChanged) { + this.openmct.time.bounds({ + start: this.embed.bounds.start, + end: this.embed.bounds.end + }); + message = 'Time bound values changed'; + } + + if (!isFixedTimespanMode) { + message = 'Time bound values changed to fixed timespan mode'; + } + this.openmct.notifications.alert(message); }, formatTime(unixTime, timeFormat) {