diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 6214ddd..087a53e 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -15,10 +15,11 @@ "minHeight": 600, "minWidth": 800, "title": "Court Pilot", - "width": 1366, - "height": 768, + "width": 800, + "height": 600, "resizable": true, - "fullscreen": true + "fullscreen": false, + "center": true } ], "security": { diff --git a/src/app/app.component.ts b/src/app/app.component.ts index f2960b2..f2b23f6 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -41,10 +41,28 @@ export class AppComponent { text: 'OK', handler: async () => { try { + // Show loading message + alert.message = + this.translationService.translate('updateDownloading'); + + // Disable the button while updating + const okButton = alert.buttons[0]; + if (typeof okButton !== 'string') { + okButton.htmlAttributes = { disabled: true }; + } + await update.downloadAndInstall(); await relaunch(); } catch (error) { console.error('Failed to install update:', error); + alert.message = + this.translationService.translate('updateFailed'); + + const okButton = alert.buttons[0]; + // Re-enable the button if the update failed + if (typeof okButton !== 'string') { + okButton.htmlAttributes = { disabled: false }; + } } } } diff --git a/src/app/i18n/translations.ts b/src/app/i18n/translations.ts index 8a0119a..ce35e06 100644 --- a/src/app/i18n/translations.ts +++ b/src/app/i18n/translations.ts @@ -45,6 +45,8 @@ export const translations = { newVersion: 'A new version {version} is available. The application will restart to install the update.', english: 'English', hungarian: 'Hungarian', + updateDownloading: 'Downloading and installing update...', + updateFailed: 'Failed to install the update. Please try again.', }, hu: { @@ -85,9 +87,11 @@ export const translations = { sendUmpiresMessage: '{umpire} - {serviceJudge}', version: 'Verzió', updateAvailable: 'Új verzió elérhető', - newVersion: 'Új elérhető verzió: {version} is available. A frissítések telepítése után az alkalmazás újraindul.', + newVersion: 'Új elérhető verzió: {version}. A frissítések telepítése után az alkalmazás újraindul.', english: 'Angol', hungarian: 'Magyar', + updateDownloading: 'Frissítés letöltése és telepítése...', + updateFailed: 'Frissítés sikertelen. Kérlek próbáld újra.', } } as const;