Fix new extension install not registering in app. (#275)

* Fix extension install not registering

* fix duplicate key compose error on extension update

* fix doubling of extension after update

* not needed
This commit is contained in:
AwkwardPeak7 2024-01-29 22:08:28 +05:00 committed by GitHub
parent aa498360db
commit 79f46b25f6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -340,9 +340,12 @@ class ExtensionManager(
override fun onExtensionUntrusted(extension: Extension.Untrusted) { override fun onExtensionUntrusted(extension: Extension.Untrusted) {
val installedExtension = _installedExtensionsFlow.value val installedExtension = _installedExtensionsFlow.value
.find { it.pkgName == extension.pkgName } .find { it.pkgName == extension.pkgName }
?: return
_installedExtensionsFlow.value -= installedExtension if (installedExtension != null) {
_untrustedExtensionsFlow.value += extension _installedExtensionsFlow.value -= installedExtension
} else {
_untrustedExtensionsFlow.value += extension
}
} }
override fun onPackageUninstalled(pkgName: String) { override fun onPackageUninstalled(pkgName: String) {