mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 21:32:34 +00:00
Remove context(parentNode: Node) and provide the parent Node as a parameter.
This commit is contained in:
+1
-1
@@ -16,8 +16,8 @@ import io.element.android.libraries.architecture.createNode
|
||||
|
||||
@ContributesBinding(AppScope::class)
|
||||
class DefaultPreferencesEntryPoint : PreferencesEntryPoint {
|
||||
context(parentNode: Node)
|
||||
override fun createNode(
|
||||
parentNode: Node,
|
||||
buildContext: BuildContext,
|
||||
params: PreferencesEntryPoint.Params,
|
||||
callback: PreferencesEntryPoint.Callback,
|
||||
|
||||
+6
-2
@@ -216,6 +216,7 @@ class PreferencesFlowNode(
|
||||
}
|
||||
NavTarget.TroubleshootNotifications -> {
|
||||
notificationTroubleShootEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
callback = object : NotificationTroubleShootEntryPoint.Callback {
|
||||
override fun onDone() {
|
||||
@@ -234,6 +235,7 @@ class PreferencesFlowNode(
|
||||
}
|
||||
NavTarget.PushHistory -> {
|
||||
pushHistoryEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
callback = object : PushHistoryEntryPoint.Callback {
|
||||
override fun onDone() {
|
||||
@@ -268,6 +270,7 @@ class PreferencesFlowNode(
|
||||
}
|
||||
NavTarget.LockScreenSettings -> {
|
||||
lockScreenEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
navTarget = LockScreenEntryPoint.Target.Settings,
|
||||
callback = object : LockScreenEntryPoint.Callback {
|
||||
@@ -287,15 +290,16 @@ class PreferencesFlowNode(
|
||||
}
|
||||
}
|
||||
logoutEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
callback = callBack,
|
||||
)
|
||||
}
|
||||
is NavTarget.OssLicenses -> {
|
||||
openSourceLicensesEntryPoint.createNode(buildContext)
|
||||
openSourceLicensesEntryPoint.createNode(this, buildContext)
|
||||
}
|
||||
NavTarget.AccountDeactivation -> {
|
||||
accountDeactivationEntryPoint.createNode(buildContext)
|
||||
accountDeactivationEntryPoint.createNode(this, buildContext)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+6
-7
@@ -57,13 +57,12 @@ class DefaultPreferencesEntryPointTest {
|
||||
val params = PreferencesEntryPoint.Params(
|
||||
initialElement = PreferencesEntryPoint.InitialTarget.NotificationSettings,
|
||||
)
|
||||
val result = with(parentNode) {
|
||||
entryPoint.createNode(
|
||||
buildContext = BuildContext.root(null),
|
||||
params = params,
|
||||
callback = callback,
|
||||
)
|
||||
}
|
||||
val result = entryPoint.createNode(
|
||||
parentNode = parentNode,
|
||||
buildContext = BuildContext.root(null),
|
||||
params = params,
|
||||
callback = callback,
|
||||
)
|
||||
assertThat(result).isInstanceOf(PreferencesFlowNode::class.java)
|
||||
assertThat(result.plugins).contains(params)
|
||||
assertThat(result.plugins).contains(callback)
|
||||
|
||||
Reference in New Issue
Block a user