Skip to content

Commit

Permalink
Deepsource fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hide-on-bush-x committed Mar 24, 2023
1 parent 44b5228 commit d1917a8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
Expand Up @@ -24,10 +24,11 @@ export const InterfaceCreateSoulname = (): JSX.Element => {

const values: { name: PaymentMethod; value: string }[] = [];
for (const token in tokensAvailable) {
values.push({
name: token as PaymentMethod,
value: tokensAvailable[token],
});
if (tokensAvailable[token])
values.push({
name: token as PaymentMethod,
value: tokensAvailable[token],
});
}

return values;
Expand Down Expand Up @@ -151,6 +152,11 @@ export const InterfaceCreateSoulname = (): JSX.Element => {
paymentMethod,
]);

const updatePaymentMethod = (e: unknown) => {
const event = e as { target: { value: PaymentMethod } };
setPaymentMethod(event.target?.value);
};

if (isLoading) return <MasaLoading />;

if (isLoadingMint)
Expand Down Expand Up @@ -270,10 +276,7 @@ export const InterfaceCreateSoulname = (): JSX.Element => {
<Select
label="Payment asset"
values={paymentMethods}
onChange={(e: unknown) => {
const event = e as { target: { value: PaymentMethod } };
setPaymentMethod(event.target?.value);
}}
onChange={updatePaymentMethod}
readOnly={true}
/>
<Input
Expand Down
2 changes: 1 addition & 1 deletion src/components/select/select.tsx
Expand Up @@ -21,7 +21,7 @@ export const Select = ({
<select className={`masa-input ${className}`} {...rest}>
{values &&
values.map((v: { name: string }) => {
return <option value={v.name}>{v.name}</option>;
return <option value={v.name} key={v.name}>{v.name}</option>;
})}
</select>
</div>
Expand Down

0 comments on commit d1917a8

Please sign in to comment.