mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 00:59:49 +01:00
Require key rotation to disable pins.
This commit is contained in:
committed by
Michelle Tang
parent
4cce6d3c86
commit
e6f11c7443
@@ -20,6 +20,7 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||
import androidx.navigation.compose.composable
|
||||
import androidx.navigation.compose.rememberNavController
|
||||
import androidx.navigation.fragment.findNavController
|
||||
import androidx.navigation.fragment.navArgs
|
||||
import org.signal.core.ui.compose.Dialogs
|
||||
import org.thoughtcrime.securesms.R
|
||||
import org.thoughtcrime.securesms.backup.v2.ui.subscription.MessageBackupsKeyRecordMode
|
||||
@@ -42,6 +43,7 @@ class BackupKeyDisplayFragment : ComposeFragment() {
|
||||
}
|
||||
|
||||
private val viewModel: BackupKeyDisplayViewModel by viewModel { BackupKeyDisplayViewModel() }
|
||||
private val args: BackupKeyDisplayFragmentArgs by navArgs()
|
||||
|
||||
@Composable
|
||||
override fun FragmentContent() {
|
||||
@@ -54,6 +56,12 @@ class BackupKeyDisplayFragment : ComposeFragment() {
|
||||
navController.enableOnBackPressed(true)
|
||||
}
|
||||
|
||||
LaunchedEffect(args.startWithKeyRotation, state.rotationState) {
|
||||
if (args.startWithKeyRotation && state.rotationState == BackupKeyRotationState.NOT_STARTED) {
|
||||
viewModel.rotateBackupKey()
|
||||
}
|
||||
}
|
||||
|
||||
LaunchedEffect(state.rotationState) {
|
||||
if (state.rotationState == BackupKeyRotationState.FINISHED) {
|
||||
setFragmentResult(AEP_ROTATION_KEY, bundleOf(AEP_ROTATION_KEY to true))
|
||||
|
||||
Reference in New Issue
Block a user