Initilize widget setting without starting its host
This commit is contained in:
@@ -2,8 +2,9 @@
|
||||
|
||||
namespace Hyperbar.Widget;
|
||||
|
||||
public class WidgetExtensionHandler(IProxyServiceCollection<IWidgetBuilder> typedServices,
|
||||
IServiceProvider provider) :
|
||||
public class WidgetExtensionHandler(IServiceProvider provider,
|
||||
IMediator mediator,
|
||||
IProxyServiceCollection<IWidgetBuilder> typedServices) :
|
||||
INotificationHandler<Created<WidgetExtension>>
|
||||
{
|
||||
public async Task Handle(Created<WidgetExtension> notification,
|
||||
@@ -21,7 +22,8 @@ public class WidgetExtensionHandler(IProxyServiceCollection<IWidgetBuilder> type
|
||||
});
|
||||
|
||||
IWidgetHost host = builder.Build();
|
||||
await host.InitializeAsync();
|
||||
await mediator.PublishAsync(new Created<IWidgetHost>(host),
|
||||
cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user