Skip to content

Commit

Permalink
Disable 2FA reset for Liquid wallets
Browse files Browse the repository at this point in the history
  • Loading branch information
angelix committed Sep 17, 2021
1 parent 8f6992b commit 73d97ff
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
Expand Up @@ -358,12 +358,19 @@ class TwoFactorAuthenticationFragment :
dialog.dismiss()
}
.setNegativeButton(android.R.string.cancel, null)
.setNeutralButton(R.string.id_i_lost_my_2fa) { _: DialogInterface, _: Int ->
navigate(TwoFactorAuthenticationFragmentDirections.actionTwoFractorAuthenticationFragmentToTwoFactorSetupFragment(
wallet = wallet,
action = TwoFactorSetupAction.RESET
))
.apply {
if(!session.isLiquid) {
setNeutralButton(R.string.id_i_lost_my_2fa) { _: DialogInterface, _: Int ->
navigate(
TwoFactorAuthenticationFragmentDirections.actionTwoFractorAuthenticationFragmentToTwoFactorSetupFragment(
wallet = wallet,
action = TwoFactorSetupAction.RESET
)
)
}
}
}

.show()
}
}
Expand Down
Expand Up @@ -50,6 +50,12 @@ class TwoFactorSetupFragment : WalletFragment<TwofactorSetupFragmentBinding>(R.l
val action = args.action

binding.vm = viewModel

if(session.isLiquid && action == TwoFactorSetupAction.RESET){
snackbar("2FA Reset is not possible in a Liquid Wallet")
popBackStack()
return
}

when(action){
TwoFactorSetupAction.SETUP -> {
Expand Down

0 comments on commit 73d97ff

Please sign in to comment.