feat: 🎸 Add warning when upgrading to 2.0 for desktop client (#2101)

This commit is contained in:
Zhihe Li authored and GitHub committed 2024-01-22 19:06:01 -05:00
1 parent 5a9cbdd913
commit 3f4beaada8
2 files changed
+11 -5

No files matched your search

@@ -107,17 +107,25 @@ const displayInfoPrompt = () => {
/**
* Show update available prompt
*/
const displayDownloadPrompt = (version, url) => {
const displayDownloadPrompt = (latestVersion, url) => {
let detail = 'A new version is available for download.';
const dialogOpts = {
type: 'info',
buttons: ['Download', 'Later'],
icon: null,
detail: 'A new version is available for download',
detail,
};
// If the user's current version is less than 2.0.0, show a warning that upgrading might not be compatible
if (semver.lt(currentVersion, '2.0.0')) {
dialogOpts.detail += `\n\nThis is a major version upgrade which could be incompatible with your current controller version.`;
dialogOpts.type = 'warning';
}
dialog.showMessageBox(dialogOpts).then((returnValue) => {
if (returnValue.response === 0) {
downloadAndInstallUpdate(version, url);
downloadAndInstallUpdate(latestVersion, url);
}
});
};
-2
View File
@@ -260,8 +260,6 @@ app.on('before-quit', (event) => {
});
app.on('quit', () => {
// TODO: Should we check if the desktop client started the daemon?
// If not, we probably shouldn't stop the daemon
clientDaemonManager.stop();
});