Don't reset the SSS toggle when logged out.
Instead, force a logout when toggling the option so user needs to log in again and create a new session using SSS.
This commit is contained in:
parent
114b12cbc7
commit
ff6ea43237
7 changed files with 81 additions and 7 deletions
|
|
@ -28,6 +28,7 @@ import androidx.compose.runtime.remember
|
|||
import androidx.compose.runtime.rememberCoroutineScope
|
||||
import androidx.compose.runtime.snapshots.SnapshotStateMap
|
||||
import io.element.android.appconfig.ElementCallConfig
|
||||
import io.element.android.features.logout.api.LogoutUseCase
|
||||
import io.element.android.features.preferences.impl.tasks.ClearCacheUseCase
|
||||
import io.element.android.features.preferences.impl.tasks.ComputeCacheSizeUseCase
|
||||
import io.element.android.features.rageshake.api.preferences.RageshakePreferencesPresenter
|
||||
|
|
@ -55,6 +56,7 @@ class DeveloperSettingsPresenter @Inject constructor(
|
|||
private val rageshakePresenter: RageshakePreferencesPresenter,
|
||||
private val appPreferencesStore: AppPreferencesStore,
|
||||
private val buildMeta: BuildMeta,
|
||||
private val logoutUseCase: LogoutUseCase,
|
||||
) : Presenter<DeveloperSettingsState> {
|
||||
@Composable
|
||||
override fun present(): DeveloperSettingsState {
|
||||
|
|
@ -119,6 +121,7 @@ class DeveloperSettingsPresenter @Inject constructor(
|
|||
DeveloperSettingsEvents.ClearCache -> coroutineScope.clearCache(clearCacheAction)
|
||||
is DeveloperSettingsEvents.SetSimplifiedSlidingSyncEnabled -> coroutineScope.launch {
|
||||
appPreferencesStore.setSimplifiedSlidingSyncEnabled(event.isEnabled)
|
||||
logoutUseCase.logout(ignoreSdkError = true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ fun DeveloperSettingsView(
|
|||
)
|
||||
PreferenceSwitch(
|
||||
title = "Enable Simplified Sliding Sync",
|
||||
subtitle = "This option requires an app restart to work.",
|
||||
subtitle = "When toggled you'll be logged out of the app and will need to log in again.",
|
||||
isChecked = state.isSimpleSlidingSyncEnabled,
|
||||
onCheckedChange = {
|
||||
state.eventSink(DeveloperSettingsEvents.SetSimplifiedSlidingSyncEnabled(it))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue