diff --git a/lawnchair/src/app/lawnchair/ui/preferences/about/NightlyBuildsRepository.kt b/lawnchair/src/app/lawnchair/ui/preferences/about/NightlyBuildsRepository.kt index 9a910a0c8a..85e48275c0 100644 --- a/lawnchair/src/app/lawnchair/ui/preferences/about/NightlyBuildsRepository.kt +++ b/lawnchair/src/app/lawnchair/ui/preferences/about/NightlyBuildsRepository.kt @@ -38,9 +38,13 @@ class NightlyBuildsRepository( val nightly = releases.firstOrNull { it.tagName == "nightly" } val asset = nightly?.assets?.firstOrNull() + // As of now the version string looks like this (CI builds only): + // ..(#) + // This is done inside build.gradle in the source root. Reflect + // changes from there if needed. val currentVersion = BuildConfig.VERSION_DISPLAY_NAME - .substringAfter("_") - .substringBefore("-") + .substringAfterLast("#") + .removeSuffix(")") .toIntOrNull() ?: 0 val latestVersion = asset?.name?.substringAfter("_")?.substringBefore("-")?.toIntOrNull() ?: 0 diff --git a/lawnchair/src/app/lawnchair/ui/preferences/destinations/ExperimentalFeaturesPreferences.kt b/lawnchair/src/app/lawnchair/ui/preferences/destinations/ExperimentalFeaturesPreferences.kt index d93db8ee63..bf7f669165 100644 --- a/lawnchair/src/app/lawnchair/ui/preferences/destinations/ExperimentalFeaturesPreferences.kt +++ b/lawnchair/src/app/lawnchair/ui/preferences/destinations/ExperimentalFeaturesPreferences.kt @@ -8,6 +8,7 @@ import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource +import androidx.lifecycle.compose.LifecycleResumeEffect import androidx.lifecycle.compose.collectAsStateWithLifecycle import app.lawnchair.preferences.getAdapter import app.lawnchair.preferences.preferenceManager @@ -112,6 +113,11 @@ fun ExperimentalFeaturesPreferences( onPermissionRequest = { fileAccessManager.refresh() }, ) } + LifecycleResumeEffect(Unit) { + showPermissionDialog = false + fileAccessManager.refresh() + onPauseOrDispose { } + } } } }