Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ All notable changes to this project will be documented in this file.
### Removed
### Fixed

## [0.75.0]
### Added
* ui: add function `updateCart()` to update the cart manually for the `ShoppingCartScreen`

## [0.75.0]
### Changed
* ui: update fiserv 3D's flow. The user now has to enter additional information to add a credit card.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package io.snabble.sdk.ui.cart.shoppingcart

import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll
Expand Down Expand Up @@ -138,7 +136,9 @@ private fun CardWithUserWeightedItems() {
items = listOf(
ProductItem(
ShoppingCart.Item(ShoppingCart(), LineItem(name = "Cold brew Coffee"))
.apply { product = Product.Builder().setType(Product.Type.UserWeighed).build() },
.apply {
product = Product.Builder().setType(Product.Type.UserWeighed).build()
},
name = "Apple",
quantity = 1,
editable = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ class ShoppingCartViewModel : ViewModel() {
}
}

fun updateCart() {
updateUiState(cachedCart)
}

init {
val project = Snabble.checkedInProject.value
val cart = Snabble.checkedInProject.value?.shoppingCart
Expand Down