mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-22 07:41:51 +01:00
Make extension list update when languages changes (#7168)
This commit is contained in:
parent
6d154b1e4f
commit
2761d27aaa
@ -15,14 +15,14 @@ class GetExtensions(
|
|||||||
) {
|
) {
|
||||||
|
|
||||||
fun subscribe(): Flow<ExtensionSegregation> {
|
fun subscribe(): Flow<ExtensionSegregation> {
|
||||||
val activeLanguages = preferences.enabledLanguages().get()
|
|
||||||
val showNsfwSources = preferences.showNsfwSource().get()
|
val showNsfwSources = preferences.showNsfwSource().get()
|
||||||
|
|
||||||
return combine(
|
return combine(
|
||||||
|
preferences.enabledLanguages().asFlow(),
|
||||||
extensionManager.getInstalledExtensionsObservable().asFlow(),
|
extensionManager.getInstalledExtensionsObservable().asFlow(),
|
||||||
extensionManager.getUntrustedExtensionsObservable().asFlow(),
|
extensionManager.getUntrustedExtensionsObservable().asFlow(),
|
||||||
extensionManager.getAvailableExtensionsObservable().asFlow(),
|
extensionManager.getAvailableExtensionsObservable().asFlow(),
|
||||||
) { _installed, _untrusted, _available ->
|
) { _activeLanguages, _installed, _untrusted, _available ->
|
||||||
|
|
||||||
val installed = _installed
|
val installed = _installed
|
||||||
.filter { it.hasUpdate.not() && (showNsfwSources || it.isNsfw.not()) }
|
.filter { it.hasUpdate.not() && (showNsfwSources || it.isNsfw.not()) }
|
||||||
@ -38,7 +38,7 @@ class GetExtensions(
|
|||||||
.filter { extension ->
|
.filter { extension ->
|
||||||
_installed.none { it.pkgName == extension.pkgName } &&
|
_installed.none { it.pkgName == extension.pkgName } &&
|
||||||
_untrusted.none { it.pkgName == extension.pkgName } &&
|
_untrusted.none { it.pkgName == extension.pkgName } &&
|
||||||
extension.lang in activeLanguages &&
|
extension.lang in _activeLanguages &&
|
||||||
(showNsfwSources || extension.isNsfw.not())
|
(showNsfwSources || extension.isNsfw.not())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user