Allow alert rules to be removed
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user