File tree 2 files changed +7
-1
lines changed
src/frontend/pages/product/[productId]
2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ the release.
7
7
8
8
## Unreleased
9
9
10
+ * [ frontend] reset quantity when new product selected
11
+ ([ #1447 ] ( https://github.com/open-telemetry/opentelemetry-demo/pull/1447 ) )
10
12
* [ featureflag] deprecate in favor of flagd
11
13
([ #1338 ] ( https://github.com/open-telemetry/opentelemetry-demo/pull/1388 ) )
12
14
* [ checkoutservice] add producer interceptor for tracing
Original file line number Diff line number Diff line change 4
4
import { NextPage } from 'next' ;
5
5
import Image from 'next/image' ;
6
6
import { useRouter } from 'next/router' ;
7
- import { useCallback , useState } from 'react' ;
7
+ import { useCallback , useState , useEffect } from 'react' ;
8
8
import { useQuery } from '@tanstack/react-query' ;
9
9
import Ad from '../../../components/Ad' ;
10
10
import Footer from '../../../components/Footer' ;
@@ -32,6 +32,10 @@ const ProductDetail: NextPage = () => {
32
32
const { selectedCurrency } = useCurrency ( ) ;
33
33
const productId = query . productId as string ;
34
34
35
+ useEffect ( ( ) => {
36
+ setQuantity ( 1 ) ;
37
+ } , [ productId ] ) ;
38
+
35
39
const {
36
40
data : {
37
41
name,
You can’t perform that action at this time.
0 commit comments