diff --git a/src/SwitchifyPc.App/App.xaml.cs b/src/SwitchifyPc.App/App.xaml.cs index e1ca353..17a2796 100644 --- a/src/SwitchifyPc.App/App.xaml.cs +++ b/src/SwitchifyPc.App/App.xaml.cs @@ -182,7 +182,7 @@ private Window CreateMainWindow() mainWindowViewModel, ShowSettingsWindow, ShowSetupGuideWindow, - ShowSettingsWindow, + InstallAvailableUpdateAsync, DisconnectBluetoothDevices, AcceptPairingApprovalAsync, RejectPairingApproval); @@ -325,6 +325,12 @@ private UpdateService CreateUpdateService() OnStateChanged: UpdateMainWindowState)); } + private Task InstallAvailableUpdateAsync() + { + return updateService?.InstallAvailableUpdateAsync() + ?? Task.FromResult(UpdateApplyResult.DownloadFailure(UpdateFailureReason.NotAvailable)); + } + private PairingApprovalManager CreatePairingApprovalManager() { return new PairingApprovalManager(new JsonPairingStore(Path.Combine(UserDataDirectory(), "pairing-state.json"))); @@ -743,7 +749,11 @@ private static bool IsInstalledApp() private void UpdateMainWindowState(UpdateState state) { RecordUpdateStateDiagnostic(state); - Dispatcher.BeginInvoke(() => mainWindowViewModel.SetUpdateState(state)); + Dispatcher.BeginInvoke(() => + { + mainWindowViewModel.SetUpdateState(state); + settingsWindow?.ApplyUpdateState(state); + }); } private void UpdateBluetoothState(BluetoothStatus status) diff --git a/src/SwitchifyPc.App/MainWindow.xaml b/src/SwitchifyPc.App/MainWindow.xaml index 4e03297..98a1b4b 100644 --- a/src/SwitchifyPc.App/MainWindow.xaml +++ b/src/SwitchifyPc.App/MainWindow.xaml @@ -314,7 +314,8 @@