Skip to content

Commit 66272fc

Browse files
committed
Allow deferring of Update Toast until the next morning
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
1 parent 1fd74f2 commit 66272fc

3 files changed

Lines changed: 7 additions & 11 deletions

File tree

src/vector/platform/ElectronPlatform.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,10 @@ export default class ElectronPlatform extends VectorBasePlatform {
275275
return this._ipcCall('getConfig');
276276
}
277277

278-
async onUpdateDownloaded(ev, updateInfo) {
279-
showUpdateToast(await this.getAppVersion(), updateInfo, updateInfo.releaseNotes);
278+
async onUpdateDownloaded(ev, {releaseNotes, releaseName}) {
279+
if (this.shouldShowUpdate(releaseName)) {
280+
showUpdateToast(await this.getAppVersion(), releaseName, releaseNotes);
281+
}
280282
}
281283

282284
getHumanReadableName(): string {

src/vector/platform/VectorBasePlatform.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,6 @@ export default abstract class VectorBasePlatform extends BasePlatform {
9393
startUpdater() {
9494
}
9595

96-
/**
97-
* Update the currently running app to the latest available
98-
* version and replace this instance of the app with the
99-
* new version.
100-
*/
101-
installUpdate() {
102-
}
103-
10496
/**
10597
* Get a sensible default display name for the
10698
* device Vector is running on

src/vector/platform/WebPlatform.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,9 @@ export default class WebPlatform extends VectorBasePlatform {
140140
if (this.runningVersion === null) {
141141
this.runningVersion = ver;
142142
} else if (this.runningVersion !== ver) {
143-
showUpdateToast(this.runningVersion, ver);
143+
if (this.shouldShowUpdate(ver)) {
144+
showUpdateToast(this.runningVersion, ver);
145+
}
144146
return { status: UpdateCheckStatus.Ready };
145147
} else {
146148
hideUpdateToast();

0 commit comments

Comments
 (0)