Skip to content

Commit 94b26d7

Browse files
committed
imp: Update version and handle all required permissions granted
- Update `VERSION_NAME` in `release.yaml` to `0.0.1+3`. - Update `requestPermissionLauncher` in `PermissionState.kt` to trigger `allRequiredGranted` after permission is granted. - Change `allRequiredGranted` function modifier to `internal`.
1 parent 8b767b7 commit 94b26d7

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.github/workflows/release.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99

1010
env:
11-
VERSION_NAME: 0.0.1+2 # Update this value for each release
11+
VERSION_NAME: 0.0.1+3 # Update this value for each release
1212

1313
jobs:
1414
release:

permissions-compose/src/main/java/com/meticha/permissions_compose/PermissionState.kt

+6-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ fun rememberAppPermissionState(permissions: List<AppPermission>): PermissionStat
5353
ActivityResultContracts.RequestPermission()
5454
) { isGranted ->
5555
when {
56-
isGranted -> permissionState.next()
56+
isGranted -> {
57+
permissionState.next()
58+
permissionState.allRequiredGranted()
59+
}
60+
5761
else -> handlePermissionDenial(permissionState, activity)
5862
}
5963
}
@@ -182,7 +186,7 @@ class PermissionState(
182186
/**
183187
* Checks if all required permissions are actually granted
184188
*/
185-
private fun allRequiredGranted(): Boolean {
189+
internal fun allRequiredGranted(): Boolean {
186190
isRequiredPermissionGranted = allPermissions
187191
.filter { it.isRequired }
188192
.all { isGranted(it.permission) }

0 commit comments

Comments
 (0)