Allow alert rules to be removed

This commit is contained in:
ajp_anton
2026-08-18 01:54:22 +00:00
parent 7f61f11cbf
commit ba09bed24f
5 changed files with 31 additions and 5 deletions
@@ -57,10 +57,13 @@ class AppRulesFragment : Fragment(R.layout.fragment_app_rules) {
android.widget.Toast.makeText(requireContext(), "Create a profile first", android.widget.Toast.LENGTH_LONG).show()
return
}
AlertRuleDialog.show(requireContext(), configuration, existing) { _, definition ->
AlertRuleDialog.show(requireContext(), configuration, existing,
onSave = { _, definition ->
store.save(if (existing == null) AlertRuleEditor.addForApps(configuration, listOf(packageName), definition) else AlertRuleEditor.updateForApp(configuration, existing.id, definition))
refresh()
}
},
onDelete = existing?.let { rule -> { store.save(AlertRuleEditor.remove(store.load(), setOf(rule.id))); refresh() } },
)
}
private fun saveOrder() {