Skip to content

Commit

Permalink
fix: prevent errors when destroying local data on launch challenge
Browse files Browse the repository at this point in the history
  • Loading branch information
arielsvg committed Oct 16, 2020
1 parent 04131f8 commit 5b814ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/assets/javascripts/services/autolock_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const STORAGE_KEY_AUTOLOCK_INTERVAL = "AutoLockIntervalKey";

export class AutolockService extends ApplicationService {

private unsubState: any
private unsubState?: () => void;
private pollFocusInterval: any
private lastFocusState?: 'hidden' | 'visible'
private lockAfterDate?: Date
Expand All @@ -42,7 +42,7 @@ export class AutolockService extends ApplicationService {
}

deinit() {
this.unsubState();
this.unsubState?.();
this.cancelAutoLockTimer();
if (this.pollFocusInterval) {
clearInterval(this.pollFocusInterval);
Expand Down
4 changes: 2 additions & 2 deletions app/assets/javascripts/views/editor/editor_view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -923,8 +923,8 @@ class EditorViewCtrl extends PureViewCtrl<{}, EditorState> {

if (
this.state.marginResizersEnabled &&
this.leftPanelPuppet!.ready &&
this.rightPanelPuppet!.ready
this.leftPanelPuppet?.ready &&
this.rightPanelPuppet?.ready
) {
const width = this.application.getPrefsService().getValue(
WebPrefKey.EditorWidth,
Expand Down

0 comments on commit 5b814ea

Please sign in to comment.