Skip to content

Commit

Permalink
Update DIToolkitPackage.cs
Browse files Browse the repository at this point in the history
create and add commands on the main UI thread to support package background loading
  • Loading branch information
AlonAm authored Sep 19, 2023
1 parent ee9b1ad commit abfb168
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Core/Shared/DIToolkitPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ protected override async Task InitializeAsync(CancellationToken cancellationToke
.Where(x => typeof(BaseDICommand).IsAssignableFrom(x.ImplementationType))
.ToList();

await JoinableTaskFactory.SwitchToMainThreadAsync();

foreach (var command in commands)
{
var baseCommandTypeGeneric = typeof(CommandWrapper<>).MakeGenericType(command.ImplementationType);
Expand Down

0 comments on commit abfb168

Please sign in to comment.