From 66272fc226a694b8a31f45917c9f3639231fba35 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 29 May 2020 19:59:48 +0100 Subject: [PATCH] Allow deferring of Update Toast until the next morning Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/vector/platform/ElectronPlatform.tsx | 6 ++++-- src/vector/platform/VectorBasePlatform.ts | 8 -------- src/vector/platform/WebPlatform.ts | 4 +++- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/vector/platform/ElectronPlatform.tsx b/src/vector/platform/ElectronPlatform.tsx index 1c178fc5f3..62137063cd 100644 --- a/src/vector/platform/ElectronPlatform.tsx +++ b/src/vector/platform/ElectronPlatform.tsx @@ -275,8 +275,10 @@ export default class ElectronPlatform extends VectorBasePlatform { return this._ipcCall('getConfig'); } - async onUpdateDownloaded(ev, updateInfo) { - showUpdateToast(await this.getAppVersion(), updateInfo, updateInfo.releaseNotes); + async onUpdateDownloaded(ev, {releaseNotes, releaseName}) { + if (this.shouldShowUpdate(releaseName)) { + showUpdateToast(await this.getAppVersion(), releaseName, releaseNotes); + } } getHumanReadableName(): string { diff --git a/src/vector/platform/VectorBasePlatform.ts b/src/vector/platform/VectorBasePlatform.ts index 5030577641..0c3997e773 100644 --- a/src/vector/platform/VectorBasePlatform.ts +++ b/src/vector/platform/VectorBasePlatform.ts @@ -93,14 +93,6 @@ export default abstract class VectorBasePlatform extends BasePlatform { startUpdater() { } - /** - * Update the currently running app to the latest available - * version and replace this instance of the app with the - * new version. - */ - installUpdate() { - } - /** * Get a sensible default display name for the * device Vector is running on diff --git a/src/vector/platform/WebPlatform.ts b/src/vector/platform/WebPlatform.ts index 054de4da49..811b46b720 100644 --- a/src/vector/platform/WebPlatform.ts +++ b/src/vector/platform/WebPlatform.ts @@ -140,7 +140,9 @@ export default class WebPlatform extends VectorBasePlatform { if (this.runningVersion === null) { this.runningVersion = ver; } else if (this.runningVersion !== ver) { - showUpdateToast(this.runningVersion, ver); + if (this.shouldShowUpdate(ver)) { + showUpdateToast(this.runningVersion, ver); + } return { status: UpdateCheckStatus.Ready }; } else { hideUpdateToast();