From 3ad3c3ca0aeeb378611f9fc96812976345969df8 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 26 May 2020 10:04:49 +0100 Subject: [PATCH] Fix super in arrow funcs Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/vector/platform/ElectronPlatform.tsx | 4 ++-- src/vector/platform/VectorBasePlatform.ts | 15 +++++++++++---- src/vector/platform/WebPlatform.ts | 4 ++-- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/vector/platform/ElectronPlatform.tsx b/src/vector/platform/ElectronPlatform.tsx index e071a97330..ae89dd711c 100644 --- a/src/vector/platform/ElectronPlatform.tsx +++ b/src/vector/platform/ElectronPlatform.tsx @@ -388,12 +388,12 @@ export default class ElectronPlatform extends VectorBasePlatform { return Boolean(feedUrl); } - startUpdateCheck = () => { + startUpdateCheck() { if (this.showUpdateCheck) return; super.startUpdateCheck(); ipcRenderer.send('check_updates'); - }; + } installUpdate() { // IPC to the main process to install the update, since quitAndInstall diff --git a/src/vector/platform/VectorBasePlatform.ts b/src/vector/platform/VectorBasePlatform.ts index b4548dd532..f59195af59 100644 --- a/src/vector/platform/VectorBasePlatform.ts +++ b/src/vector/platform/VectorBasePlatform.ts @@ -39,6 +39,13 @@ export default abstract class VectorBasePlatform extends BasePlatform { protected showUpdateCheck: boolean = false; protected _favicon: Favicon; + constructor() { + super(); + + this.startUpdateCheck = this.startUpdateCheck.bind(this); + this.stopUpdateCheck = this.stopUpdateCheck.bind(this); + } + async getConfig(): Promise<{}> { return getVectorConfig(); } @@ -96,21 +103,21 @@ export default abstract class VectorBasePlatform extends BasePlatform { return false; } - startUpdateCheck = () => { + startUpdateCheck() { this.showUpdateCheck = true; dis.dispatch({ action: 'check_updates', value: { status: updateCheckStatusEnum.CHECKING }, }); - }; + } - stopUpdateCheck = () => { + stopUpdateCheck() { this.showUpdateCheck = false; dis.dispatch({ action: 'check_updates', value: false, }); - }; + } getUpdateCheckStatusEnum() { return updateCheckStatusEnum; diff --git a/src/vector/platform/WebPlatform.ts b/src/vector/platform/WebPlatform.ts index d43fe12ff2..1b0a6d6d4d 100644 --- a/src/vector/platform/WebPlatform.ts +++ b/src/vector/platform/WebPlatform.ts @@ -154,7 +154,7 @@ export default class WebPlatform extends VectorBasePlatform { }); }; - startUpdateCheck = () => { + startUpdateCheck() { if (this.showUpdateCheck) return; super.startUpdateCheck(); this.pollForUpdate().then((updateState) => { @@ -165,7 +165,7 @@ export default class WebPlatform extends VectorBasePlatform { value: updateState, }); }); - }; + } installUpdate() { window.location.reload(true);