Skip to content

Commit ec4b836

Browse files
committed
frontend: fix preselcted account on buy page's account dropdown
1 parent 79ebb57 commit ec4b836

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

frontends/web/src/components/groupedaccountselector/groupedaccountselector.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ const GroupHeading = (
118118

119119
export const GroupedAccountSelector = ({ title, disabled, selected, onChange, onProceed, accounts }: TAccountSelector) => {
120120
const { t } = useTranslation();
121-
const [selectedAccount, setSelectedAccount] = useState<string>();
122121
const [options, setOptions] = useState<TGroupedOption[]>();
123122

124123
useEffect(() => {
@@ -146,11 +145,10 @@ export const GroupedAccountSelector = ({ title, disabled, selected, onChange, on
146145
label: t('buy.info.selectLabel'),
147146
value: 'choose',
148147
disabled: true
149-
} : options.flatMap(o => o.options).find(oo => oo.value === selectedAccount)}
148+
} : options.flatMap(o => o.options).find(opt => opt.value === selected)}
150149
onChange={(e) => {
151150
const value = (e as SingleValue<TOption>)?.value || '';
152151
onChange(value);
153-
setSelectedAccount(value);
154152
}}
155153
components={{
156154
Group,

0 commit comments

Comments
 (0)