From 819536523cce4a63758b42ed6e5ba748891ccaa5 Mon Sep 17 00:00:00 2001 From: Martin Quarda Date: Wed, 16 Oct 2024 16:03:48 +0200 Subject: [PATCH] fix --- frontend/src/scripts/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/scripts/index.js b/frontend/src/scripts/index.js index c61bf91..8bf5293 100644 --- a/frontend/src/scripts/index.js +++ b/frontend/src/scripts/index.js @@ -45,7 +45,7 @@ class Main extends Component { this.setState({products: json}) }) fetch(addr_prefix + "/api/cart").then(resp => resp.json()).then(json => { - this.setState({cart: json}) + this.setState({cart: [...json, ...this.state.cart]}) }) fetch(addr_prefix + "/api/login_status").then(resp => resp.json()).then(json => { this.setState({login_status: json})