File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
app/src/main/java/to/bitkit/ui/screens/wallets/send Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,8 @@ import androidx.compose.ui.res.stringResource
4545import androidx.compose.ui.tooling.preview.Preview
4646import androidx.compose.ui.unit.dp
4747import androidx.compose.ui.viewinterop.AndroidView
48+ import androidx.lifecycle.Lifecycle
49+ import androidx.lifecycle.LifecycleEventObserver
4850import androidx.lifecycle.compose.LocalLifecycleOwner
4951import com.google.accompanist.permissions.ExperimentalPermissionsApi
5052import com.google.accompanist.permissions.isGranted
@@ -110,8 +112,17 @@ fun SendRecipientScreen(
110112 .build()
111113 }
112114
113- LaunchedEffect (Unit ) {
114- cameraPermissionState.launchPermissionRequest()
115+ DisposableEffect (lifecycleOwner) {
116+ val observer = LifecycleEventObserver { _, event ->
117+ if (event == Lifecycle .Event .ON_START ) {
118+ cameraPermissionState.launchPermissionRequest()
119+ }
120+ }
121+ lifecycleOwner.lifecycle.addObserver(observer)
122+
123+ onDispose {
124+ lifecycleOwner.lifecycle.removeObserver(observer)
125+ }
115126 }
116127
117128 // QR code analyzer with auto-proceed callback
You can’t perform that action at this time.
0 commit comments