Skip to content

Commit ca07219

Browse files
committed
refactor: handle type issue
1 parent b028e22 commit ca07219

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/extension-polkagate/src/fullscreen/accountDetails/components/AssetSelect.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { useAssetHubAssets, useTokens } from '../../../hooks';
1111

1212
interface Props {
1313
address: string | undefined;
14-
onChange: (value: number) => void;
14+
onChange: (value: number | string) => void;
1515
label: string;
1616
style: SxProps<Theme> | undefined;
1717
assetId: number | undefined;

packages/extension-polkagate/src/fullscreen/accountDetails/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,14 @@ export default function AccountDetails (): React.ReactElement {
150150
}
151151
}, [genesisHash, accountAssets, assetId, paramAssetId, selectedAsset]);
152152

153-
const onChangeAsset = useCallback((id: number) => {
153+
const onChangeAsset = useCallback((id: number | string) => {
154154
if (id === -1) { // this is the id of native token
155155
setAssetIdOnAssetHub(0);
156156

157157
return;
158158
}
159159

160-
setAssetIdOnAssetHub(id); // this works for asset hubs atm
160+
setAssetIdOnAssetHub(id as number); // this works for asset hubs atm
161161
}, []);
162162

163163
const goToSend = useCallback(() => {

0 commit comments

Comments
 (0)