Skip to content

Commit

Permalink
feat: 仅显示已安装APP的规则
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed Oct 6, 2023
1 parent b3f7126 commit 2e454eb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/src/main/java/li/songe/gkd/util/SubsState.kt
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ val appIdToRulesFlow by lazy {
val appIdToRules = mutableMapOf<String, MutableList<Rule>>()
subsItems.filter { it.enable }.forEach { subsItem ->
(subsIdToRaw[subsItem.id]?.apps ?: emptyList()).filter { appRaw ->
// 筛选当前启用的 app 订阅规则
appSubsConfigs.find { subsConfig ->
// 筛选 已经安装的 APP 和 当前启用的 app 订阅规则
appInfoCache.containsKey(appRaw.id) && (appSubsConfigs.find { subsConfig ->
subsConfig.subsItemId == subsItem.id && subsConfig.appId == appRaw.id
}?.enable ?: true
}?.enable ?: true)
}.forEach { appRaw ->
val rules = appIdToRules[appRaw.id] ?: mutableListOf()
appIdToRules[appRaw.id] = rules
Expand Down

0 comments on commit 2e454eb

Please sign in to comment.