mirror of
https://github.com/nasa/openmct.git
synced 2025-01-27 14:49:28 +00:00
fix missing clock on independent time mode change
This commit is contained in:
parent
a0299820ed
commit
0254367cd5
@ -324,8 +324,16 @@ class IndependentTimeContext extends TimeContext {
|
||||
return this.upstreamTimeContext.setMode(...arguments);
|
||||
}
|
||||
|
||||
if (mode === MODES.realtime && this.activeClock === undefined) {
|
||||
throw `Unknown clock. Has a clock been registered with 'addClock'?`;
|
||||
if (mode === MODES.realtime) {
|
||||
// TODO: This should probably happen up front in creating an independent time context
|
||||
// TODO: not just in time every time setMode is called
|
||||
if (this.activeClock === undefined) {
|
||||
this.activeClock = this.globalTimeContext.getClock();
|
||||
}
|
||||
|
||||
if (this.activeClock === undefined) {
|
||||
throw `Unknown clock. Has a clock been registered with 'addClock'?`;
|
||||
}
|
||||
}
|
||||
|
||||
if (mode !== this.mode) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user