Prevent blank tag addition and remove 'path "name" is required' error

This commit is contained in:
Hafizzle 2023-09-15 13:35:12 -04:00
parent 0abbdc80dc
commit 754e0b0537

View file

@ -205,6 +205,11 @@ class TaskFilterDialog(context: Context, private val repository: TagRepository,
}
private fun stopEditing() {
// Filter out tags with empty names
val tagsToRemove = createdTags.values.filter { it.name.isBlank() }
createdTags.values.removeAll(tagsToRemove.toSet())
tags.removeAll(tagsToRemove)
isEditingTags = false
binding.tagsList.removeAllViews()
createTagViews()