Fix wallet ordering on creation

This commit is contained in:
TheXamlGuy
2024-07-07 21:27:37 +01:00
parent 45624031c0
commit afa72d8e14
3 changed files with 7 additions and 6 deletions
+3 -1
View File
@@ -5,6 +5,7 @@ using Toolkit.Foundation;
namespace Wallet;
public class CreateWalletHandler(IWalletHostFactory componentFactory,
IWalletHostCollection wallets,
IPublisher publisher) :
IHandler<CreateEventArgs<Wallet<(string, string, IImageDescriptor?)>>, bool>
{
@@ -23,9 +24,10 @@ public class CreateWalletHandler(IWalletHostFactory componentFactory,
IWalletFactory walletFactory = host.Services.GetRequiredService<IWalletFactory>();
if (await walletFactory.Create(name, password, imageDescriptor))
{
wallets.Add(host);
host.Start();
publisher.Publish(Activated.As(new Wallet<IComponentHost>(host)));
publisher.Publish(Activated.As(new Wallet<IComponentHost>(host)));
return true;
}
}