Skip to content

Commit 4805ac4

Browse files
committed
feat: show what's new dialog after update first boot
1 parent 0c3ec90 commit 4805ac4

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

src/extensionsIntegrated/appUpdater/main.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ define(function (require, exports, module) {
4646

4747
const TAURI_UPDATER_WINDOW_LABEL = "updater",
4848
KEY_LAST_UPDATE_CHECK_TIME = "PH_LAST_UPDATE_CHECK_TIME",
49+
KEY_LAST_UPDATE_DESCRIPTION = "PH_LAST_UPDATE_DESCRIPTION",
4950
KEY_UPDATE_AVAILABLE = "PH_UPDATE_AVAILABLE";
5051

5152
const PREFS_AUTO_UPDATE = "autoUpdate";
@@ -292,6 +293,10 @@ define(function (require, exports, module) {
292293
_updateWithConfirmDialog(isUpgradableLoc, updateDetails);
293294
} else if(!updaterWindow) {
294295
Metrics.countEvent(Metrics.EVENT_TYPE.UPDATES, 'auto', "silent"+Phoenix.platform);
296+
PreferencesManager.setViewState(KEY_LAST_UPDATE_DESCRIPTION, {
297+
releaseNotesMarkdown: updateDetails.releaseNotesMarkdown,
298+
updateVersion: updateDetails.updateVersion
299+
});
295300
doUpdate(updateDetails.downloadURL);
296301
}
297302
}
@@ -598,6 +603,13 @@ define(function (require, exports, module) {
598603
});
599604
showOrHideUpdateIcon();
600605
_refreshUpdateStatus();
606+
const lastUpdateDetails = PreferencesManager.getViewState(KEY_LAST_UPDATE_DESCRIPTION);
607+
if(lastUpdateDetails && (lastUpdateDetails.updateVersion === Phoenix.metadata.apiVersion)) {
608+
let markdownHtml = marked.parse(lastUpdateDetails.releaseNotesMarkdown || "");
609+
Dialogs.showInfoDialog(Strings.UPDATE_WHATS_NEW, markdownHtml);
610+
PreferencesManager.setViewState(KEY_LAST_UPDATE_DESCRIPTION, null);
611+
PreferencesManager.setViewState(KEY_UPDATE_AVAILABLE, false);
612+
}
601613
// check for updates at boot
602614
let lastUpdateCheckTime = PreferencesManager.getViewState(KEY_LAST_UPDATE_CHECK_TIME);
603615
const currentTime = Date.now();

src/nls/root/strings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,7 @@ define({
612612
"UPDATE_NOT_AVAILABLE_TITLE": "{APP_NAME} is up to date",
613613
"UPDATE_UP_TO_DATE": "Your version of {APP_NAME} is the latest!",
614614
"UPDATE_AVAILABLE_TITLE": "Update Available",
615+
"UPDATE_WHATS_NEW": "What's New in {APP_NAME}",
615616
"UPDATE_READY_RESTART_TITLE": "Restart App to Update",
616617
"UPDATE_READY_RESTART_INSTALL_MESSAGE": "{APP_NAME} will be updated automatically when you close all open windows.",
617618
"UPDATE_FAILED_TITLE": "Update Failed",
@@ -624,7 +625,6 @@ define({
624625
"UPDATE_ON_EXIT": "Update On Exit",
625626
"UPDATE_LATER": "Remind Me Later",
626627
"UPDATE_DONE": "Restart to Update {APP_NAME}",
627-
"UPDATE_RESTART": "Restart to apply updates",
628628
"UPDATE_RESTART_INSTALL": "Restart to install updates",
629629
"UPDATE_DOWNLOADING": "Downloading Installer",
630630
"INSTALL_WEBAPP": "Install {APP_NAME} on Your Device",

0 commit comments

Comments
 (0)