Merge branches 'develop' and 't3chguy/toasts3_2' of github.com:vector-im/riot-web into t3chguy/toasts3_2

This commit is contained in:
Michael Telatynski 2020-05-27 09:58:08 +01:00
commit c17bcda1ba
8 changed files with 611 additions and 513 deletions

View file

@ -384,12 +384,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

View file

@ -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;

View file

@ -157,7 +157,7 @@ export default class WebPlatform extends VectorBasePlatform {
});
};
startUpdateCheck = () => {
startUpdateCheck() {
if (this.showUpdateCheck) return;
super.startUpdateCheck();
this.pollForUpdate().then((updateState) => {
@ -168,7 +168,7 @@ export default class WebPlatform extends VectorBasePlatform {
value: updateState,
});
});
};
}
installUpdate() {
window.location.reload(true);