fix: prevent errors when destroying local data on launch challenge
This commit is contained in:
@@ -15,7 +15,7 @@ const STORAGE_KEY_AUTOLOCK_INTERVAL = "AutoLockIntervalKey";
|
|||||||
|
|
||||||
export class AutolockService extends ApplicationService {
|
export class AutolockService extends ApplicationService {
|
||||||
|
|
||||||
private unsubState: any
|
private unsubState?: () => void;
|
||||||
private pollFocusInterval: any
|
private pollFocusInterval: any
|
||||||
private lastFocusState?: 'hidden' | 'visible'
|
private lastFocusState?: 'hidden' | 'visible'
|
||||||
private lockAfterDate?: Date
|
private lockAfterDate?: Date
|
||||||
@@ -42,7 +42,7 @@ export class AutolockService extends ApplicationService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
deinit() {
|
deinit() {
|
||||||
this.unsubState();
|
this.unsubState?.();
|
||||||
this.cancelAutoLockTimer();
|
this.cancelAutoLockTimer();
|
||||||
if (this.pollFocusInterval) {
|
if (this.pollFocusInterval) {
|
||||||
clearInterval(this.pollFocusInterval);
|
clearInterval(this.pollFocusInterval);
|
||||||
|
|||||||
@@ -923,8 +923,8 @@ class EditorViewCtrl extends PureViewCtrl<{}, EditorState> {
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
this.state.marginResizersEnabled &&
|
this.state.marginResizersEnabled &&
|
||||||
this.leftPanelPuppet!.ready &&
|
this.leftPanelPuppet?.ready &&
|
||||||
this.rightPanelPuppet!.ready
|
this.rightPanelPuppet?.ready
|
||||||
) {
|
) {
|
||||||
const width = this.application.getPrefsService().getValue(
|
const width = this.application.getPrefsService().getValue(
|
||||||
WebPrefKey.EditorWidth,
|
WebPrefKey.EditorWidth,
|
||||||
|
|||||||
Reference in New Issue
Block a user