mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-27 07:16:54 +00:00
fix: address minor bugs in updater and permission (#5707)
* fix(updater): prevent update checker from always showing * fix(permissions): refresh state on request to fix stale experimental features UI
This commit is contained in:
@@ -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):
|
||||
// <major>.<branch>.(#<CI build number>)
|
||||
// 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
|
||||
|
||||
@@ -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 { }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user