Allow deferring of Update Toast until the next morning

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2020-05-29 19:59:47 +01:00
parent f45c584c8a
commit 9431393bda
3 changed files with 42 additions and 2 deletions

View file

@ -40,6 +40,10 @@ function installUpdate() {
}
export const showToast = (version: string, newVersion: string, releaseNotes?: string) => {
function onReject() {
PlatformPeg.get().deferUpdate(newVersion);
}
let onAccept;
let acceptLabel = _t("What's new?");
if (releaseNotes) {
@ -79,6 +83,8 @@ export const showToast = (version: string, newVersion: string, releaseNotes?: st
description: _t("A new version of Riot is available!"),
acceptLabel,
onAccept,
rejectLabel: _t("Later"),
onReject,
},
component: GenericToast,
priority: 20,