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})