diff --git a/KeyVaultExplorer/App.axaml.cs b/KeyVaultExplorer/App.axaml.cs index 9a1cd2c..0c6a704 100644 --- a/KeyVaultExplorer/App.axaml.cs +++ b/KeyVaultExplorer/App.axaml.cs @@ -36,13 +36,12 @@ public static void CreateDesktopResources() DatabaseEncryptedPasswordManager.SetSecret($"keyvaultexplorer_{System.Guid.NewGuid().ToString()[..6]}"); - Task.Run(async () => - { + Dispatcher.UIThread.Post(async () => { await KvExplorerDb.OpenSqlConnection(); if (!dbExists) KvExplorerDb.InitializeDatabase(); - }); + }, DispatcherPriority.Loaded); string settingsPath = Path.Combine(Constants.LocalAppDataFolder, "settings.json"); if (!File.Exists(settingsPath))