Rename fun in Callback for clarity.

This commit is contained in:
Benoit Marty 2025-10-29 10:30:30 +01:00 committed by Benoit Marty
parent 353c00e032
commit 43972dba68
104 changed files with 658 additions and 664 deletions

View file

@ -82,23 +82,22 @@ class FtueSessionVerificationFlowNode(
return when (navTarget) {
is NavTarget.Root -> {
val callback = object : ChooseSelfVerificationModeNode.Callback {
override fun onUseAnotherDevice() {
override fun navigateToUseAnotherDevice() {
backstack.push(NavTarget.UseAnotherDevice)
}
override fun onUseRecoveryKey() {
override fun navigateToUseRecoveryKey() {
backstack.push(NavTarget.EnterRecoveryKey)
}
override fun onResetKey() {
override fun navigateToResetKey() {
backstack.push(NavTarget.ResetIdentity)
}
override fun onLearnMoreAboutEncryption() {
override fun navigateToLearnMoreAboutEncryption() {
learnMoreUrl.value = LearnMoreConfig.DEVICE_VERIFICATION_URL
}
}
createNode<ChooseSelfVerificationModeNode>(buildContext, plugins = listOf(callback))
}
is NavTarget.UseAnotherDevice -> {
@ -116,7 +115,7 @@ class FtueSessionVerificationFlowNode(
backstack.pop()
}
override fun onLearnMoreAboutEncryption() {
override fun navigateToLearnMoreAboutEncryption() {
// Note that this callback is never called. The "Learn more" link is not displayed
// for the self session interactive verification.
}

View file

@ -29,10 +29,10 @@ class ChooseSelfVerificationModeNode(
private val directLogoutView: DirectLogoutView,
) : Node(buildContext, plugins = plugins) {
interface Callback : Plugin {
fun onUseAnotherDevice()
fun onUseRecoveryKey()
fun onResetKey()
fun onLearnMoreAboutEncryption()
fun navigateToUseAnotherDevice()
fun navigateToUseRecoveryKey()
fun navigateToResetKey()
fun navigateToLearnMoreAboutEncryption()
}
private val callback = plugins<Callback>().first()
@ -43,10 +43,10 @@ class ChooseSelfVerificationModeNode(
ChooseSelfVerificationModeView(
state = state,
onUseAnotherDevice = callback::onUseAnotherDevice,
onUseRecoveryKey = callback::onUseRecoveryKey,
onResetKey = callback::onResetKey,
onLearnMore = callback::onLearnMoreAboutEncryption,
onUseAnotherDevice = callback::navigateToUseAnotherDevice,
onUseRecoveryKey = callback::navigateToUseRecoveryKey,
onResetKey = callback::navigateToResetKey,
onLearnMore = callback::navigateToLearnMoreAboutEncryption,
modifier = modifier,
)