Fix migrate warning response
@@ -30,7 +30,6 @@ export default async projectPath => {
currentVersion = "1.0.0";
}
- return new Promise((resolve, reject) => {
if (fromFuture(currentVersion)) {
const dialogOptions = {
type: "info",
@@ -48,22 +47,19 @@ export default async projectPath => {
version: LATEST_PROJECT_VERSION
})
};
- dialog.showMessageBox(dialogOptions, (buttonIndex, checkboxChecked) => {
- if (buttonIndex === 0) {
- shell.openExternal("https://www.gbstudio.dev/download/");
- return reject();
+ const { response: updateButtonIndex } = await dialog.showMessageBox(dialogOptions);
+ if (updateButtonIndex === 0) {
+ await shell.openExternal("https://www.gbstudio.dev/download/");
+ return false;
}
- if (buttonIndex === 2) {
- return reject();
+ if (updateButtonIndex === 2) {
+ return false;
}
- return resolve(true);
- });
- return;
+ return true;
}
if (!needsUpdate(currentVersion)) {
- resolve(true);
- return;
+ return true;
}
const dialogOptions = {
@@ -84,15 +80,14 @@ export default async projectPath => {
})
};
- dialog.showMessageBox(dialogOptions, (buttonIndex, checkboxChecked) => {
+ const {response: buttonIndex, checkboxChecked} = await dialog.showMessageBox(dialogOptions);
+
if (checkboxChecked) {
// Ignore all updates until manually check for updates
settings.set("dontCheckForUpdates", true);
}
if (buttonIndex === 0) {
- return resolve(true);
+ return true;
}
- return resolve(false);
- });
- });
+ return false;
};
