| ... | @@ -535,7 +535,28 @@ function handleCheckForUpdatesMenuClick(): void { | ... | @@ -535,7 +535,28 @@ function handleCheckForUpdatesMenuClick(): void { |
| 535 | if (!BrowserWindow.getAllWindows().length) { | 535 | if (!BrowserWindow.getAllWindows().length) { |
| 536 | mainWindow = createWindow(); | 536 | mainWindow = createWindow(); |
| 537 | } | 537 | } |
| 538 | void checkForUpdates("menu"); | 538 | void checkForUpdatesFromMenu(); |
| | 539 | } |
| | 540 | |
| | 541 | async function checkForUpdatesFromMenu(): Promise<void> { |
| | 542 | await checkForUpdates("menu"); |
| | 543 | |
| | 544 | if (updateState.status === "up-to-date") { |
| | 545 | void dialog.showMessageBox({ |
| | 546 | type: "info", |
| | 547 | title: "You're up to date!", |
| | 548 | message: `T3 Code ${updateState.currentVersion} is currently the newest version available.`, |
| | 549 | buttons: ["OK"], |
| | 550 | }); |
| | 551 | } else if (updateState.status === "error") { |
| | 552 | void dialog.showMessageBox({ |
| | 553 | type: "warning", |
| | 554 | title: "Update check failed", |
| | 555 | message: "Could not check for updates.", |
| | 556 | detail: updateState.message ?? "An unknown error occurred. Please try again later.", |
| | 557 | buttons: ["OK"], |
| | 558 | }); |
| | 559 | } |
| 539 | } | 560 | } |
| 540 | | 561 | |
| 541 | function configureApplicationMenu(): void { | 562 | function configureApplicationMenu(): void { |