mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Merge pull request #3570 from Flow-Launcher/exitting_null
Fix main window null when checking exiting
This commit is contained in:
commit
dc0454b014
4 changed files with 4 additions and 4 deletions
|
|
@ -32,7 +32,7 @@ namespace Flow.Launcher
|
|||
#region Public Properties
|
||||
|
||||
public static IPublicAPI API { get; private set; }
|
||||
public static bool Exiting => _mainWindow.CanClose;
|
||||
public static bool LoadingOrExiting => _mainWindow == null || _mainWindow.CanClose;
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ public partial class SettingWindow
|
|||
_viewModel.PropertyChanged -= ViewModel_PropertyChanged;
|
||||
|
||||
// If app is exiting, settings save is not needed because main window closing event will handle this
|
||||
if (App.Exiting) return;
|
||||
if (App.LoadingOrExiting) return;
|
||||
// Save settings when window is closed
|
||||
_settings.Save();
|
||||
App.API.SavePluginSettings();
|
||||
|
|
|
|||
|
|
@ -1729,7 +1729,7 @@ namespace Flow.Launcher.ViewModel
|
|||
public void Show()
|
||||
{
|
||||
// When application is exiting, we should not show the main window
|
||||
if (App.Exiting) return;
|
||||
if (App.LoadingOrExiting) return;
|
||||
|
||||
// When application is exiting, the Application.Current will be null
|
||||
Application.Current?.Dispatcher.Invoke(() =>
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ namespace Flow.Launcher
|
|||
private void Window_Closed(object sender, EventArgs e)
|
||||
{
|
||||
// If app is exiting, settings save is not needed because main window closing event will handle this
|
||||
if (App.Exiting) return;
|
||||
if (App.LoadingOrExiting) return;
|
||||
// Save settings when window is closed
|
||||
_settings.Save();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue