From 9be8f2b20958996af760b9004462980ef464b556 Mon Sep 17 00:00:00 2001 From: Thomas Andres Gomez Date: Mon, 16 Jun 2025 23:44:58 +0200 Subject: [PATCH] Fix regression when adding an non stackable item. --- .../composable/character/item/ItemDetailDialogViewModel.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composeApp/src/commonMain/kotlin/com/pixelized/desktop/lwa/ui/composable/character/item/ItemDetailDialogViewModel.kt b/composeApp/src/commonMain/kotlin/com/pixelized/desktop/lwa/ui/composable/character/item/ItemDetailDialogViewModel.kt index fb5c403..974468d 100644 --- a/composeApp/src/commonMain/kotlin/com/pixelized/desktop/lwa/ui/composable/character/item/ItemDetailDialogViewModel.kt +++ b/composeApp/src/commonMain/kotlin/com/pixelized/desktop/lwa/ui/composable/character/item/ItemDetailDialogViewModel.kt @@ -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(