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(