remove dismissing an update

This commit is contained in:
qimiko committed 2024-06-18 05:19:55 -07:00
1 parent 50f4a5d8e3
commit 70934a95ad
3 files changed
+7 -39

No files matched your search

@@ -91,15 +91,6 @@ class ReleaseManager private constructor(
}
}
fun dismissLauncherUpdate() {
val update = availableLauncherUpdate.value ?: return
val sharedPreferences = PreferenceUtils.get(applicationContext)
sharedPreferences.setString(PreferenceUtils.Key.LAST_DISMISSED_UPDATE, update.tagName)
_availableLauncherUpdate.value = null
}
private suspend fun getLatestRelease(): Release? {
val sharedPreferences = PreferenceUtils.get(applicationContext)
val useNightly = sharedPreferences.getBoolean(PreferenceUtils.Key.RELEASE_CHANNEL)
@@ -167,13 +158,6 @@ class ReleaseManager private constructor(
}
private fun checkLauncherUpdate(launcherUpdate: Release) {
val sharedPreferences = PreferenceUtils.get(applicationContext)
val lastDismissedVersion = sharedPreferences.getString(PreferenceUtils.Key.LAST_DISMISSED_UPDATE)
if (!lastDismissedVersion.isNullOrEmpty() && launcherUpdate.tagName == lastDismissedVersion) {
return
}
if (launcherUpdate.tagName != BuildConfig.VERSION_NAME) {
_availableLauncherUpdate.value = launcherUpdate
}
@@ -98,10 +98,4 @@ class ReleaseViewModel(private val application: Application): ViewModel() {
syncUiState(releaseFlow)
}
}
fun dismissLauncherUpdate() {
viewModelScope.launch(Dispatchers.IO) {
ReleaseManager.get(application).dismissLauncherUpdate()
}
}
}