Commit e6e4c66c authored by Daniel Wolf's avatar Daniel Wolf
Browse files

Only show the rule count for non-staged sources

parent 70147456
......@@ -279,8 +279,9 @@ class DnsRuleActivity : BaseActivity() {
})
}
data.enabled -> launchWithLifecylce(false) {
val prev = sourceRuleCount[data]
sourceRuleCount[data] = getDatabase().dnsRuleDao().getCountForHostSource(data.id)
runOnUiThread {
if(prev != sourceRuleCount[data]) runOnUiThread {
sourceAdapter.notifyItemChanged(position)
}
}
......
......@@ -90,7 +90,7 @@ interface DnsRuleDao {
@Delete
fun remove(rule:DnsRule)
@Query("SELECT COUNT(*) FROM DnsRule WHERE importedFrom=:hostSourceId")
@Query("SELECT COUNT(*) FROM DnsRule WHERE importedFrom=:hostSourceId AND stagingType=0")
fun getCountForHostSource(hostSourceId:Long):Int
@Query("SELECT * FROM DnsRule WHERE importedFrom IS NOT NULL AND host=:host AND type=:type AND stagingType=2 LIMIT 1")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment