Unverified Commit 29ff40ee authored by Michael Telatynski's avatar Michael Telatynski Committed by GitHub

Merge pull request #13808 from vector-im/t3chguy/arrow-funcs-super

Fix manual update checking, super in arrow funcs doesn't work
parents 6723e71e 3ad3c3ca
......@@ -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
......
......@@ -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;
......
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment