Skip to content

Commit 3381944

Browse files
authored
Fix: Fixed issue where resuming didn't work once it failed (#14290)
1 parent e2fb851 commit 3381944

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Files.App/App.xaml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,12 @@ async Task ActivateAsync()
116116
/// <summary>
117117
/// Invoked when the application is activated.
118118
/// </summary>
119-
public void OnActivated(AppActivationArguments activatedEventArgs)
119+
public async Task OnActivatedAsync(AppActivationArguments activatedEventArgs)
120120
{
121121
Logger.LogInformation($"The app is being activated. Activation type: {activatedEventArgs.Data.GetType().Name}");
122122

123123
// InitializeApplication accesses UI, needs to be called on UI thread
124-
_ = MainWindow.Instance.DispatcherQueue.EnqueueOrInvokeAsync(()
124+
await MainWindow.Instance.DispatcherQueue.EnqueueOrInvokeAsync(()
125125
=> MainWindow.Instance.InitializeApplicationAsync(activatedEventArgs.Data));
126126
}
127127

src/Files.App/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,12 @@ private static void Main()
158158
});
159159
}
160160

161-
private static void OnActivated(object? sender, AppActivationArguments args)
161+
private static async void OnActivated(object? sender, AppActivationArguments args)
162162
{
163163
if (App.Current is App thisApp)
164164
{
165165
// WINUI3: Verify if needed or OnLaunched is called
166-
thisApp.OnActivated(args);
166+
await thisApp.OnActivatedAsync(args);
167167
}
168168
}
169169

0 commit comments

Comments
 (0)