-
Notifications
You must be signed in to change notification settings - Fork 719
Add generic passwork checker before sending transaction #867
base: master
Are you sure you want to change the base?
Add generic passwork checker before sending transaction #867
Conversation
@BloodyPixy I have added a new coordinator, forgot that name, take a look in the Lock coordinators. I haven’t done much tho. |
this has to be separated an tested. |
@BloodyPixy You need to pass view model that will describe actions! |
|
||
let transaction = configurator.signTransaction | ||
if needsPasscodeCheck { | ||
delegate?.confirmPaymentControllerNeedsAuthentication(self) |
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.
is there a way to check this on coordinator level?
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.
Done
…ansactions * master: Add option to skip import main wallet Disable AuthenticateUserCoordinatorTests Version bump Use valueToSend() Add RPCServer as new parameter of the NonFungibleTokenObject. So now we could open nftokens. (#872) Fix an issue with adding extra ether to each transaction Enable deletion of the main wallet Average USD field update on QR code scanning. (#861)
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.
@BloodyPixy can you add tests?
$0.title = self?.viewModel.verifyTransactionsWithPasscodeTitle | ||
$0.value = self?.viewModel.isPasscodeTransactionLockEnabled | ||
$0.hidden = Condition.function([Values.passcodeRow], { form in | ||
return !((form.rowBy(tag: Values.passcodeRow) as? SwitchRow)?.value ?? false) |
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.
Do something along this:
var privateKeyRow: TextAreaRow? {
return form.rowBy(tag: Values.privateKey)
}
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 mean for passcodeRow, and use it instead of this
!((form.rowBy(tag: Values.passcodeRow) as? SwitchRow)?.value ?? false)
like this
!(self?.passcodeRow?.value ?? false)
,
did I get you right?
@@ -328,6 +349,12 @@ final class SettingsViewController: FormViewController, Coordinator { | |||
self.autoLockRow.reload() | |||
} | |||
|
|||
private func updatePasscodeTransactionLockRow(enabled: Bool) { | |||
self.viewModel.isPasscodeTransactionLockEnabled = enabled |
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.
do not use self
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.
Done
} | ||
|
||
var verifyTransactionsWithPasscodeTitle: String { | ||
return NSLocalizedString("settings.lockTransactions.label.title", value: "Authenticate Transactions", comment: "") |
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.
Use R
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.
Done
|
||
extension ConfirmCoordinator: ConfirmPaymentAuthenticationDelegate { | ||
func confirmPaymentControllerNeedsAuthentication(_ controller: ConfirmPaymentViewController) { | ||
guard let needsPasscodeCheck = PreferencesController() |
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.
This means you can modify user defaults to enable this feature?
It needs to be stored on keychain level then
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.
Done
I decided to put it inside of the lock. Seems logical to me, as we use Lock for keychain work with a passcode, and transaction authorization is directly connected to it. Good thing would be to have a new icon for this option in settings, as for now it uses same icon as Passcode app lock. It works like this:
|
…ansactions * master: Move reload into separate function Crash: Signing on watch address via browser #885 fix crash when signing on watch address via browser #885 (#887) Update localized string and use R Move into separate function Update Analitics.swift (#882) Link "Settings → Telegram Group" should open channel according to user's locale (#879) Improve currentWalletDescriptionString Move Help center higher in order Version Bump
Let's hold off on this one. It still requires UX/UI work to figure this out. |
Referencing #830, I will create new coordinator for this one, and reuse the
LockEnterPasscodeViewController
.I would like to get some info before finishing: