Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI stays no responsive when the amount entered with many decimals #456

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/hooks/spacewalk/useIssuePallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { H256 } from '@polkadot/types/interfaces';
import type { SpacewalkPrimitivesIssueIssueRequest, SpacewalkPrimitivesVaultId } from '@polkadot/types/lookup';
import { useMemo } from 'preact/hooks';
import { useNodeInfoState } from '../../NodeInfoProvider';
import { Compact, u128 } from '@polkadot/types-codec';

export interface RichIssueRequest {
id: H256;
Expand Down Expand Up @@ -46,7 +47,10 @@ export function useIssuePallet() {
return undefined;
}

return api.tx.issue?.requestIssue(amount, vaultId);
const integerAmount = parseFloat(amount).toFixed(0);
ebma marked this conversation as resolved.
Show resolved Hide resolved
const compactAmount: Compact<u128> = api.createType('Compact<u128>', integerAmount);

return api.tx.issue?.requestIssue(compactAmount, vaultId);
},
};
}, [api]);
Expand Down
Loading