File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
app/src/main/java/to/bitkit/ui/utils Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import androidx.activity.compose.rememberLauncherForActivityResult
66import androidx.activity.result.contract.ActivityResultContracts
77import androidx.compose.runtime.Composable
88import androidx.compose.runtime.DisposableEffect
9+ import androidx.compose.runtime.LaunchedEffect
910import androidx.compose.runtime.getValue
1011import androidx.compose.runtime.mutableStateOf
1112import androidx.compose.runtime.remember
@@ -57,15 +58,13 @@ fun RequestNotificationPermissions(
5758 }
5859
5960 // Request permission on first composition if needed
60- DisposableEffect (Unit ) {
61+ LaunchedEffect (Unit ) {
6162 val currentPermissionState = NotificationUtils .areNotificationsEnabled(context)
6263 isGranted = currentPermissionState
6364 onPermissionChange(currentPermissionState)
6465
6566 if (! currentPermissionState && requiresPermission && showPermissionDialog) {
6667 launcher.launch(Manifest .permission.POST_NOTIFICATIONS )
6768 }
68-
69- onDispose { }
7069 }
7170}
You can’t perform that action at this time.
0 commit comments