Add banner for optional migration to simplified sliding sync (#3429)
* Add banner for optional migration to native sliding sync - Add `MatrixClient.isNativeSlidingSyncSupported()` and `MatrixClient.isUsingNativeSlidingSync` to check whether the home server supports native sliding sync and we're already using it. - Add `NativeSlidingSyncMigrationBanner` composable to the `RoomList` screen when the home server supports native sliding sync but the current session is not using it. - Add an extra logout successful action to the logout flow, create `EnableNativeSlidingSyncUseCase` so it can be used there. * Update screenshots * Make sure the sliding sync migration banner has lower priority than the encryption setup ones --------- Co-authored-by: ElementBot <benoitm+elementbot@element.io>
This commit is contained in:
parent
7549d5f475
commit
67e262fdc8
32 changed files with 283 additions and 12 deletions
|
|
@ -27,6 +27,15 @@ class DefaultLogoutEntryPoint @Inject constructor() : LogoutEntryPoint {
|
|||
return this
|
||||
}
|
||||
|
||||
override fun onSuccessfulLogoutPendingAction(action: () -> Unit): LogoutEntryPoint.NodeBuilder {
|
||||
plugins += object : LogoutNode.SuccessfulLogoutPendingAction, Plugin {
|
||||
override fun onSuccessfulLogoutPendingAction() {
|
||||
action()
|
||||
}
|
||||
}
|
||||
return this
|
||||
}
|
||||
|
||||
override fun build(): Node {
|
||||
return parentNode.createNode<LogoutNode>(buildContext, plugins)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,12 @@ class LogoutNode @AssistedInject constructor(
|
|||
plugins<LogoutEntryPoint.Callback>().forEach { it.onChangeRecoveryKeyClick() }
|
||||
}
|
||||
|
||||
interface SuccessfulLogoutPendingAction : Plugin {
|
||||
fun onSuccessfulLogoutPendingAction()
|
||||
}
|
||||
|
||||
private val customOnSuccessfulLogoutPendingAction = plugins<SuccessfulLogoutPendingAction>().firstOrNull()
|
||||
|
||||
@Composable
|
||||
override fun View(modifier: Modifier) {
|
||||
val state = presenter.present()
|
||||
|
|
@ -41,7 +47,10 @@ class LogoutNode @AssistedInject constructor(
|
|||
LogoutView(
|
||||
state = state,
|
||||
onChangeRecoveryKeyClick = ::onChangeRecoveryKeyClick,
|
||||
onSuccessLogout = { onSuccessLogout(activity, isDark, it) },
|
||||
onSuccessLogout = {
|
||||
customOnSuccessfulLogoutPendingAction?.onSuccessfulLogoutPendingAction()
|
||||
onSuccessLogout(activity, isDark, it)
|
||||
},
|
||||
onBackClick = ::navigateUp,
|
||||
modifier = modifier,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue