Do not respond to bounds tick changes (#3106)

Co-authored-by: Deep Tailor <deep.j.tailor@nasa.gov>
This commit is contained in:
Andrew Henry 2020-06-23 13:14:17 -07:00 committed by GitHub
parent 0399766ccd
commit 31ac67b393
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,7 +24,7 @@ import {
setAllSearchParams
} from 'utils/openmctLocation';
const TIME_EVENTS = ['bounds', 'timeSystem', 'clock', 'clockOffsets'];
const TIME_EVENTS = ['timeSystem', 'clock', 'clockOffsets'];
const SEARCH_MODE = 'tc.mode';
const SEARCH_TIME_SYSTEM = 'tc.timeSystem';
const SEARCH_START_BOUND = 'tc.startBound';
@ -42,6 +42,7 @@ export default class URLTimeSettingsSynchronizer {
this.destroy = this.destroy.bind(this);
this.updateTimeSettings = this.updateTimeSettings.bind(this);
this.setUrlFromTimeApi = this.setUrlFromTimeApi.bind(this);
this.updateBounds = this.updateBounds.bind(this);
openmct.on('start', this.initialize);
openmct.on('destroy', this.destroy);
@ -54,7 +55,7 @@ export default class URLTimeSettingsSynchronizer {
TIME_EVENTS.forEach(event => {
this.openmct.time.on(event, this.setUrlFromTimeApi);
});
this.openmct.time.on('bounds', this.updateBounds);
}
destroy() {
@ -65,6 +66,7 @@ export default class URLTimeSettingsSynchronizer {
TIME_EVENTS.forEach(event => {
this.openmct.time.off(event, this.setUrlFromTimeApi);
});
this.openmct.time.on('bounds', this.updateBounds);
}
updateTimeSettings() {
@ -72,7 +74,6 @@ export default class URLTimeSettingsSynchronizer {
if (!this.isUrlUpdateInProgress) {
let timeParameters = this.parseParametersFromUrl();
if (this.areTimeParametersValid(timeParameters)) {
this.setTimeApiFromUrl(timeParameters);
} else {
@ -138,6 +139,12 @@ export default class URLTimeSettingsSynchronizer {
}
}
updateBounds(bounds, isTick) {
if (!isTick) {
this.setUrlFromTimeApi();
}
}
setUrlFromTimeApi() {
let searchParams = getAllSearchParams();
let clock = this.openmct.time.clock();