Skip to content

Commit

Permalink
Update context-dropdown.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
alexprudhomme committed Nov 12, 2024
1 parent e974690 commit c695486
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default function ContextDropdown({
}: {
useCase?: 'listing' | 'search';
}) {
const {state, controller} = useContext();
const {state, methods} = useContext();
const engine = useEngine();

return (
Expand All @@ -34,9 +34,9 @@ export default function ContextDropdown({
value={`${state.language}-${state.country}-${state.currency}`}
onChange={(e) => {
const [language, country, currency] = e.target.value.split('-');
controller?.setLanguage(language);
controller?.setCountry(country);
controller?.setCurrency(currency as ContextOptions['currency']);
methods?.setLanguage(language);
methods?.setCountry(country);
methods?.setCurrency(currency as ContextOptions['currency']);

useCase === 'search'
? engine?.dispatch(
Expand Down

0 comments on commit c695486

Please sign in to comment.