Skip to content

Commit 23a1e5b

Browse files
committed
Initialize public api instance in constructor so that we can use App.API all the time
1 parent bb25774 commit 23a1e5b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Flow.Launcher/App.xaml.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ public App()
5454
.AddSingleton<MainViewModel>()
5555
).Build();
5656
Ioc.Default.ConfigureServices(host.Services);
57+
58+
// Initialize the public API first
59+
API = Ioc.Default.GetRequiredService<IPublicAPI>();
5760
}
5861

5962
[STAThread]
@@ -73,8 +76,6 @@ private async void OnStartupAsync(object sender, StartupEventArgs e)
7376
{
7477
await Stopwatch.NormalAsync("|App.OnStartup|Startup cost", async () =>
7578
{
76-
API = Ioc.Default.GetRequiredService<IPublicAPI>();
77-
7879
Ioc.Default.GetRequiredService<Updater>().Initialize(Launcher.Properties.Settings.Default.GithubRepo);
7980

8081
Ioc.Default.GetRequiredService<Portable>().PreStartCleanUpAfterPortabilityUpdate();

0 commit comments

Comments
 (0)