Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 8 additions & 14 deletions src/Files.App/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,6 @@ private static void EnsureSettingsAndConfigurationAreBootstrapped()
FileTagsManager ??= new FileTagsManager();
SidebarPinnedController ??= new SidebarPinnedController();
TerminalController ??= new TerminalController();

//FileTagsHelpers.UpdateTagsDb();
FileOperationsHelpers.WaitForCompletion();
}

private static async Task StartAppCenter()
Expand Down Expand Up @@ -209,6 +206,7 @@ await Task.WhenAll(
JumpList.InitializeAsync(),
ContextFlyoutItemHelper.CachedNewContextMenuEntries
);
FileTagsHelper.UpdateTagsDb();
});

// Check for required updates
Expand Down Expand Up @@ -243,17 +241,8 @@ protected override void OnLaunched(LaunchActivatedEventArgs e)
EnsureWindowIsInitialized();

EnsureSettingsAndConfigurationAreBootstrapped();
Task.Run(async () =>
{
try
{
await InitializeAppComponentsAsync();
}
catch (Exception ex)
{
Logger.Warn(ex, "Error during InitializeAppComponentsAsync()");
}
});

_ = InitializeAppComponentsAsync().ContinueWith(t => Logger.Warn(t.Exception, "Error during InitializeAppComponentsAsync()"), TaskContinuationOptions.OnlyOnFaulted);

_ = Window.InitializeApplication(activatedEventArgs);
}
Expand Down Expand Up @@ -294,6 +283,8 @@ private async void Window_Closed(object sender, WindowEventArgs args)
{
// Save application state and stop any background activity

await Task.Yield(); // Method can take a long time, make sure the window is hidden

SaveSessionTabs();

if (OutputPath is not null)
Expand Down Expand Up @@ -324,6 +315,9 @@ await SafetyExtensions.IgnoreExceptions(async () =>
Clipboard.Flush();
}
}, Logger);

// Wait for ongoing file operations
FileOperationsHelpers.WaitForCompletion();
}

public static void SaveSessionTabs() // Enumerates through all tabs and gets the Path property and saves it to AppSettings.LastSessionPages
Expand Down