mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-07 11:17:25 +01:00
ExtensionManger: Fix unofficial extension has update (#7503)
This commit is contained in:
parent
0b4f3f5532
commit
64f60c36e6
@ -211,7 +211,9 @@ class ExtensionManager(
|
|||||||
mutInstalledExtensions[index] = installedExt.copy(isObsolete = true)
|
mutInstalledExtensions[index] = installedExt.copy(isObsolete = true)
|
||||||
changed = true
|
changed = true
|
||||||
} else if (availableExt != null) {
|
} else if (availableExt != null) {
|
||||||
val hasUpdate = availableExt.versionCode > installedExt.versionCode
|
val hasUpdate = !installedExt.isUnofficial &&
|
||||||
|
availableExt.versionCode > installedExt.versionCode
|
||||||
|
|
||||||
if (installedExt.hasUpdate != hasUpdate) {
|
if (installedExt.hasUpdate != hasUpdate) {
|
||||||
mutInstalledExtensions[index] = installedExt.copy(hasUpdate = hasUpdate)
|
mutInstalledExtensions[index] = installedExt.copy(hasUpdate = hasUpdate)
|
||||||
changed = true
|
changed = true
|
||||||
@ -381,7 +383,7 @@ class ExtensionManager(
|
|||||||
*/
|
*/
|
||||||
private fun Extension.Installed.withUpdateCheck(): Extension.Installed {
|
private fun Extension.Installed.withUpdateCheck(): Extension.Installed {
|
||||||
val availableExt = availableExtensions.find { it.pkgName == pkgName }
|
val availableExt = availableExtensions.find { it.pkgName == pkgName }
|
||||||
if (availableExt != null && availableExt.versionCode > versionCode) {
|
if (isUnofficial.not() && availableExt != null && availableExt.versionCode > versionCode) {
|
||||||
return copy(hasUpdate = true)
|
return copy(hasUpdate = true)
|
||||||
}
|
}
|
||||||
return this
|
return this
|
||||||
|
Loading…
Reference in New Issue
Block a user