[Notebook] display bounds change notification only if bounds changed (#3062) Resolves (#3051)

* display bounds change notification only if bounds changed

* avoid empty notification messages.
This commit is contained in:
Nikhil 2020-05-28 12:29:32 -07:00 committed by GitHub
parent 04598b6cf1
commit 8363c65312
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -169,12 +169,10 @@ export default {
const bounds = this.openmct.time.bounds();
const isTimeBoundChanged = this.embed.bounds.start !== bounds.start
&& this.embed.bounds.end !== bounds.end;
|| this.embed.bounds.end !== bounds.end;
const isFixedTimespanMode = !this.openmct.time.clock();
this.openmct.time.stopClock();
window.location.href = link;
let message = '';
if (isTimeBoundChanged) {
this.openmct.time.bounds({
@ -188,7 +186,11 @@ export default {
message = 'Time bound values changed to fixed timespan mode';
}
this.openmct.notifications.alert(message);
if (message.length) {
this.openmct.notifications.alert(message);
}
window.location.href = link;
},
formatTime(unixTime, timeFormat) {
return Moment.utc(unixTime).format(timeFormat);