File tree Expand file tree Collapse file tree
static/js/publisher/components/StoreSelector Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import { brandStoresState } from "../../state/brandStoreState";
66import ComboBox from "../ComboBox/ComboBox" ;
77
88function StoreSelector ( ) : React . JSX . Element {
9- const { id } = useParams ( ) ;
9+ const { id : storeId } = useParams ( ) ;
1010 const navigate = useNavigate ( ) ;
1111 const brandStoresList = useAtomValue ( brandStoresState ) ;
1212
@@ -22,14 +22,15 @@ function StoreSelector(): React.JSX.Element {
2222 return (
2323 < ComboBox
2424 options = { comboBoxOptions }
25- value = { id ?? "" }
25+ value = { storeId ?? "" }
2626 label = "Select store"
2727 placeholder = "Select store"
2828 labelClassName = "u-off-screen"
2929 required
30- onChange = { ( storeId ) => {
31- if ( ! storeId ) return ;
32- navigate ( `/admin/${ storeId } /snaps` ) ;
30+ onChange = { ( newStoreId ) => {
31+ if ( ! newStoreId ) return ;
32+ if ( storeId === newStoreId ) return ;
33+ navigate ( `/admin/${ newStoreId } /snaps` ) ;
3334 } }
3435 />
3536 ) ;
You can’t perform that action at this time.
0 commit comments