forked from geode-sdk/android-launcher
only show unsupported version once
This commit is contained in:
1 file changed
+7
-1
@@ -235,7 +235,11 @@ fun UpdateWarning() {
|
||||
|
||||
var showUpdateWarning by remember { mutableStateOf(true) }
|
||||
|
||||
if (gdVersionCode != Constants.SUPPORTED_VERSION_CODE) {
|
||||
var lastDismissedVersion by PreferenceUtils.useLongPreference(
|
||||
preferenceKey = PreferenceUtils.Key.DISMISSED_GJ_UPDATE
|
||||
)
|
||||
|
||||
if (gdVersionCode != Constants.SUPPORTED_VERSION_CODE && gdVersionCode != lastDismissedVersion) {
|
||||
if (showUpdateWarning) {
|
||||
AlertDialog(
|
||||
icon = {
|
||||
@@ -256,6 +260,8 @@ fun UpdateWarning() {
|
||||
confirmButton = {
|
||||
TextButton(onClick = {
|
||||
showUpdateWarning = false
|
||||
lastDismissedVersion = gdVersionCode
|
||||
|
||||
onLaunch(context)
|
||||
}) {
|
||||
Text(stringResource(R.string.message_box_accept))
|
||||
|
||||
Reference in new issue
Block a user