Assign category positions inside the database
A new category's position is computed by its insert, one after the highest, so two categories created at once can't take the same one. Inserts take a NewCategory rather than a Category whose id and position would be ignored. Reordering places any category missing from the given order after the rest instead of leaving it at a stale position. Restore still creates missing categories all or none, in backup order, and the create dialog no longer accepts an empty name.
This commit is contained in:
@@ -110,7 +110,7 @@ fun CategoryRenameDialog(
|
||||
onDismissRequest = onDismissRequest,
|
||||
confirmButton = {
|
||||
TextButton(
|
||||
enabled = valueHasChanged && !nameAlreadyExists,
|
||||
enabled = valueHasChanged && name.isNotEmpty() && !nameAlreadyExists,
|
||||
onClick = {
|
||||
onRename(name)
|
||||
onDismissRequest()
|
||||
|
||||
Reference in New Issue
Block a user