-
Notifications
You must be signed in to change notification settings - Fork 492
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] Make password button texts depends on intent #11778
[VDG] Make password button texts depends on intent #11778
Conversation
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.
I guess it should also be Send
at speeding up/cancel a transaction dialog?
@@ -26,10 +28,22 @@ public PasswordAuthDialogViewModel(IWalletModel wallet) | |||
AuthorizationFailedMessage = $"The password is incorrect.{Environment.NewLine}Please try again."; | |||
} | |||
|
|||
public string ContinueText => Intent == PasswordRequestIntent.Send ? "SEND" : "Next"; |
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.
public string ContinueText => Intent == PasswordRequestIntent.Send ? "SEND" : "Next"; | |
public string ContinueText => Intent == PasswordRequestIntent.Send ? "Send" : "Next"; |
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.
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 doesn't just pass the string via ctor?
I did exactly that initially, but looked a bit redundant when we actually have only 2 values. I can restore this approach if you think it's enough/convenient. |
Yes, please. Just keep it simple |
@@ -16,7 +16,7 @@ public static AuthorizationDialogBase GetAuthorizationDialog(IWalletModel wallet | |||
} | |||
else | |||
{ | |||
return new PasswordAuthDialogViewModel(wallet, PasswordRequestIntent.Send); | |||
return new PasswordAuthDialogViewModel(wallet, "SEND"); |
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.
[NavigationMetaData(Title = "Enter your password", NavigationTarget = NavigationTarget.CompactDialogScreen)] | ||
public partial class PasswordAuthDialogViewModel : AuthorizationDialogBase | ||
{ | ||
private readonly IWalletModel _wallet; | ||
[AutoNotify] private string _password; | ||
|
||
public PasswordAuthDialogViewModel(IWalletModel wallet, PasswordRequestIntent intent) | ||
public PasswordAuthDialogViewModel(IWalletModel wallet, string continueText) |
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.
string continueText = "Continue"
and only pass it where Send
is required.
@@ -281,7 +281,7 @@ private void RegisterViewModels() | |||
{ | |||
// TODO: Remove reference to WalletRepository when this ViewModel is Decoupled | |||
// TODO: Why is this code duplicated? | |||
var pwAuthDialog = new PasswordAuthDialogViewModel(walletViewModel.WalletModel, PasswordRequestIntent.Other); | |||
var pwAuthDialog = new PasswordAuthDialogViewModel(walletViewModel.WalletModel, "Next"); |
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.
Wasn't it Continue
before?
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.
yes it is
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.
You're right. I don't know why I changed it...
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.
ACK 12b6188
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.
tACK
This adapts the password request view to show "Next" or "SEND", depending on the intent of the request.
Replaces #11594 (review)