Ensure profile images show on newly created wallets
This commit is contained in:
@@ -22,8 +22,12 @@ public class WalletActivatedHandler(IWalletHostCollection Wallets,
|
||||
{
|
||||
if (host.Services.GetRequiredService<IServiceFactory>() is IServiceFactory serviceFactory)
|
||||
{
|
||||
IDecoratorService<ProfileImage<IImageDescriptor>> profileImageDecorator =
|
||||
host.Services.GetRequiredService<IDecoratorService<ProfileImage<IImageDescriptor>>>();
|
||||
|
||||
ProfileImage<IImageDescriptor>? profileImage = profileImageDecorator.Service;
|
||||
if (serviceFactory.Create<WalletNavigationViewModel>(args => args.Initialize(),
|
||||
descriptor.Name, false)
|
||||
descriptor.Name, profileImage?.Value, false)
|
||||
is WalletNavigationViewModel viewModel)
|
||||
{
|
||||
publisher.Publish(Insert.As<IMainNavigationViewModel>(index, viewModel),
|
||||
|
||||
@@ -10,7 +10,13 @@ public class WalletCollectionInitializer(IHostEnvironment environment,
|
||||
{
|
||||
public void Initialize()
|
||||
{
|
||||
foreach (string wallet in Directory.EnumerateDirectories(Path.Combine(environment.ContentRootPath, "Wallet")))
|
||||
string path = Path.Combine(environment.ContentRootPath, "Wallet");
|
||||
if (!Directory.Exists(path))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (string wallet in Directory.EnumerateDirectories(path))
|
||||
{
|
||||
string name = Path.GetFileName(wallet);
|
||||
string section = $"Wallet:{name}";
|
||||
|
||||
Reference in New Issue
Block a user