Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: enabling app lock manually displays the dialog turn off #2469

Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ fun SettingsScreen(
viewModel: SettingsViewModel = hiltViewModel()
) {
val lazyListState: LazyListState = rememberLazyListState()
val turnAppLockOffDialogState = rememberVisibilityState<Unit>()
val onAppLockSwitchClicked: (Boolean) -> Unit = remember {
{ isChecked ->
if (isChecked) homeStateHolder.navigator.navigate(NavigationCommand(SetLockCodeScreenDestination, BackStackMode.NONE))
else turnAppLockOffDialogState.show(Unit)
}
}

val context = LocalContext.current
SettingsScreenContent(
lazyListState = lazyListState,
Expand All @@ -66,13 +74,9 @@ fun SettingsScreen(
)
}
},
onAppLockSwitchChanged = remember {
{ isChecked ->
if (isChecked) homeStateHolder.navigator.navigate(NavigationCommand(SetLockCodeScreenDestination, BackStackMode.NONE))
else viewModel.disableAppLock()
}
}
onAppLockSwitchChanged = onAppLockSwitchClicked
)
TurnAppLockOffDialog(dialogState = turnAppLockOffDialogState, turnOff = viewModel::disableAppLock)
}

@Composable
Expand All @@ -84,7 +88,6 @@ fun SettingsScreenContent(
) {
val context = LocalContext.current
val featureVisibilityFlags = LocalFeatureVisibilityFlags.current
val turnAppLockOffDialogState = rememberVisibilityState<Unit>()

with(featureVisibilityFlags) {
LazyColumn(
Expand Down Expand Up @@ -113,6 +116,7 @@ fun SettingsScreenContent(
}
add(SettingsItem.NetworkSettings)
add(SettingsItem.AppLock(
<<<<<<< HEAD
when (settingsState.appLockConfig) {
is AppLockConfig.Disabled -> SwitchState.Enabled(
value = false,
Expand All @@ -124,6 +128,18 @@ fun SettingsScreenContent(
isOnOffVisible = true
) {
turnAppLockOffDialogState.show(Unit)
=======
when (settingsState.isAppLockEditable) {
true -> {
appLogger.d("AppLockConfig isAooLockEditable: ${settingsState.isAppLockEditable}")

appLogger.d("AppLockConfig isAppLockEnabled: ${settingsState.isAppLockEnabled}")
SwitchState.Enabled(
value = settingsState.isAppLockEnabled,
isOnOffVisible = true,
onCheckedChange = onAppLockSwitchChanged
)
>>>>>>> dd3cb91b8 (LAST_COMMIT_MESSAGE)
}
is AppLockConfig.EnforcedByTeam -> {
SwitchState.TextOnly(true)
Expand All @@ -150,8 +166,6 @@ fun SettingsScreenContent(
)
}
}

TurnAppLockOffDialog(dialogState = turnAppLockOffDialogState) { onAppLockSwitchChanged(false) }
}

private fun LazyListScope.folderWithElements(
Expand Down
2 changes: 1 addition & 1 deletion kalium
Submodule kalium updated 62 files
+1 −1 README.md
+9 −0 cryptography/src/androidMain/kotlin/com/wire/kalium/cryptography/ProteusClientCryptoBoxImpl.kt
+5 −1 cryptography/src/appleMain/kotlin/com/wire/kalium/cryptography/MLSClientImpl.kt
+5 −0 cryptography/src/appleMain/kotlin/com/wire/kalium/cryptography/ProteusClientCoreCryptoImpl.kt
+11 −2 cryptography/src/commonJvmAndroid/kotlin/com.wire.kalium.cryptography/MLSClientImpl.kt
+4 −0 cryptography/src/commonJvmAndroid/kotlin/com.wire.kalium.cryptography/ProteusClientCoreCryptoImpl.kt
+5 −3 cryptography/src/commonMain/kotlin/com/wire/kalium/cryptography/IDs.kt
+11 −1 cryptography/src/commonMain/kotlin/com/wire/kalium/cryptography/MLSClient.kt
+3 −0 cryptography/src/commonMain/kotlin/com/wire/kalium/cryptography/ProteusClient.kt
+5 −1 cryptography/src/jsMain/kotlin/com/wire/kalium/cryptography/MLSClientImpl.kt
+6 −0 cryptography/src/jsMain/kotlin/com/wire/kalium/cryptography/ProteusClientCryptoBoxImpl.kt
+5 −0 cryptography/src/jvmMain/kotlin/com/wire/kalium/cryptography/ProteusClientCryptoBoxImpl.kt
+2 −2 gradle/libs.versions.toml
+4 −0 logic/src/commonMain/kotlin/com/wire/kalium/logic/GlobalKaliumScope.kt
+1 −1 logic/src/commonMain/kotlin/com/wire/kalium/logic/configuration/AppLockTeamConfig.kt
+27 −10 logic/src/commonMain/kotlin/com/wire/kalium/logic/configuration/UserConfigRepository.kt
+36 −38 logic/src/commonMain/kotlin/com/wire/kalium/logic/data/asset/AssetMapper.kt
+1 −1 logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/MLSConversationRepository.kt
+1 −1 logic/src/commonMain/kotlin/com/wire/kalium/logic/data/legalhold/LastPreKey.kt
+25 −0 logic/src/commonMain/kotlin/com/wire/kalium/logic/data/legalhold/LegalHoldRequest.kt
+6 −1 logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/Message.kt
+3 −2 logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/MessageMapper.kt
+3 −2 logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/MessageRepository.kt
+11 −1 logic/src/commonMain/kotlin/com/wire/kalium/logic/data/prekey/PreKeyRepository.kt
+5 −5 logic/src/commonMain/kotlin/com/wire/kalium/logic/data/session/SessionRepository.kt
+14 −33 logic/src/commonMain/kotlin/com/wire/kalium/logic/data/team/TeamRepository.kt
+17 −2 logic/src/commonMain/kotlin/com/wire/kalium/logic/data/user/UserRepository.kt
+20 −2 logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/UserSessionScope.kt
+6 −32 logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/applock/AppLockTeamFeatureConfigObserver.kt
+11 −1 logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/asset/GetMessageAssetUseCase.kt
+3 −1 logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/backup/BackupConstants.kt
+47 −0 logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/featureConfig/IsAppLockEditableUseCase.kt
+2 −2 logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/featureConfig/handler/AppLockConfigHandler.kt
+1 −1 ...src/commonMain/kotlin/com/wire/kalium/logic/feature/featureConfig/handler/ClassifiedDomainsConfigHandler.kt
+84 −0 logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/legalhold/ApproveLegalHoldUseCase.kt
+37 −0 logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/legalhold/ObserveLegalHoldForSelfUserUseCase.kt
+90 −0 logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/legalhold/ObserveLegalHoldRequestUseCase.kt
+60 −0 logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/legalhold/ObserveLegalHoldStateForUserUseCase.kt
+6 −9 logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/team/SyncSelfTeamUseCase.kt
+7 −0 logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/team/TeamScope.kt
+2 −2 ...in/kotlin/com/wire/kalium/logic/feature/user/screenshotCensoring/ObserveScreenshotCensoringConfigUseCase.kt
+1 −5 logic/src/commonMain/kotlin/com/wire/kalium/logic/featureFlags/KaliumConfigs.kt
+10 −9 logic/src/commonTest/kotlin/com/wire/kalium/logic/data/conversation/MLSConversationRepositoryTest.kt
+20 −53 logic/src/commonTest/kotlin/com/wire/kalium/logic/data/team/TeamRepositoryTest.kt
+36 −0 logic/src/commonTest/kotlin/com/wire/kalium/logic/data/user/UserRepositoryTest.kt
+4 −34 logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/applock/AppLockTeamFeatureConfigObserverTest.kt
+2 −2 logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/asset/GetMessageAssetUseCaseTest.kt
+165 −0 logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/legalhold/ApproveLegalHoldUseCaseTest.kt
+98 −0 logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/legalhold/ObserveLegalHoldForSelfUserUseCaseTest.kt
+148 −0 logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/legalhold/ObserveLegalHoldRequestUseCaseTest.kt
+134 −0 logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/legalhold/ObserveLegalHoldStateForUserUseCaseTest.kt
+3 −24 logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/team/SyncSelfTeamUseCaseTest.kt
+10 −9 ...tlin/com/wire/kalium/logic/feature/user/screeenshotCensoring/ObserveScreenshotCensoringConfigUseCaseTest.kt
+5 −0 network/src/commonMain/kotlin/com/wire/kalium/network/api/base/authenticated/TeamsApi.kt
+11 −0 network/src/commonMain/kotlin/com/wire/kalium/network/api/v0/authenticated/TeamsApiV0.kt
+5 −0 network/src/commonMain/kotlin/com/wire/kalium/network/exceptions/KaliumException.kt
+1 −0 network/src/commonMain/kotlin/com/wire/kalium/network/exceptions/NetworkErrorLabel.kt
+32 −0 network/src/commonTest/kotlin/com/wire/kalium/api/v0/teams/TeamsApiV0Test.kt
+1 −1 persistence/src/commonMain/kotlin/com/wire/kalium/persistence/dao/MetadataDAO.kt
+1 −1 persistence/src/commonMain/kotlin/com/wire/kalium/persistence/dao/MetadataDAOImpl.kt
+6 −1 persistence/src/commonMain/kotlin/com/wire/kalium/persistence/dao/message/MessageEntity.kt
+3 −3 persistence/src/commonMain/kotlin/com/wire/kalium/persistence/dao/unread/UserConfigDAO.kt
Loading