New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[VDG] UI Decoupling #24 #10730
[VDG] UI Decoupling #24 #10730
Conversation
return new WalletSettingsModel(keyManager, true); | ||
} | ||
|
||
public IWalletModel SaveWallet(IWalletSettingsModel walletSettings) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The result is not used anywhere ?
using NBitcoin; | ||
using System.Threading.Tasks; | ||
using WalletWasabi.Fluent.Models.Wallets; | ||
|
||
namespace WalletWasabi.Fluent.Models.UI; | ||
|
||
#nullable disable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not fix nullable annotations in IWalletListModel ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also public IWalletModel? DefaultWallet => null;
has nullable annotation which results in warning.
.Subscribe(); | ||
|
||
DefaultWallet = | ||
wallets.FirstOrDefault(item => item.Name == Services.UiConfig.LastSelectedWallet) | ||
?? wallets.FirstOrDefault(); | ||
_wallets.FirstOrDefault(item => item.Name == Services.UiConfig.LastSelectedWallet) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not part of this PR but I wonder isn't second FirstOrDefault() really needed ?
@ichthus1604 LGTM just added some comments |
@ichthus1604 Fixed DS issues and CF issues (remaining are not part of this PR). |
@molnard Seems CF did not update properly, all of the issues are already fixed. This PR can be merged but I can't because of CF. |
WalletSettingsModel
introduced in [VDG] UI Decoupling #22 #10716 because it doesn't really make sense.IWalletListModel
. This abstraction has now become effectively the Wallet Repository, and thus needs to be renamed. This rename will happen in the next PR.CreateNewWalletAsync()
andRecoverWalletAsync()
both returnIWalletSettingsModel
, to properly represent the fact that the wallet hasn't been created at that point, which happens inIWalletListModel.SaveWallet()
which does properly returnIWalletModel
.WalletSettingsModel
to work with aKeyManager
instead of aWallet
due to the above.KeyManager.SetAnonScore(int anonScore, bool toFile)
method since it's no longer usedbool toFile
parameter fromKeyManager.SetFeeRateMedianTimeFrame()
method since it's no longer used.IWalletSettingsModel.IsNewWallet
property which is internally set when creating / recovering wallets, removing the need to pass this value as a loose boolean parameter manually between ViewModels.WalletManager
in theOnNavigatedTo()
event of theAddedWalletPageViewModel
. This doesn't really make sense because wallet persistence should not depend on whether a particular dialog is shown or not in the UI. This logic has been moved toCoinjoinProfilesViewModel.OnNext()
so that the wallet is persisted and added toWalletManager
immediately after the user hits Next on that screen.