Fix regression when adding an non stackable item.

This commit is contained in:
Thomas Andres Gomez 2025-06-16 23:44:58 +02:00
parent 48a461396a
commit 9be8f2b209

View file

@ -86,9 +86,9 @@ class ItemDetailDialogViewModel(
): Boolean {
try {
if (dialog.countable?.errorFlow?.value == true) return false
val quantity = dialog.countable?.valueFlow?.value ?: return false
val count = factory.parse(quantity = quantity)
?: quantity.toFloatOrNull()
val quantity = dialog.countable?.valueFlow?.value
val count = factory.parse(quantity = quantity ?: "")
?: quantity?.toFloatOrNull()
?: 1f
// create the inventory item on the server, get the newly create id from that.
inventoryRepository.createInventoryItem(