Skip to content

Commit

Permalink
Merge pull request #19 from subsquid/develop
Browse files Browse the repository at this point in the history
release
  • Loading branch information
belopash authored May 23, 2024
2 parents 502d479 + 360c702 commit b5876f2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/pages/GatewaysPage/GatewaysPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function MyStakes() {
{data?.pendingStake ? formatSqd(SQD_TOKEN, data?.pendingStake?.amount) : '-'}
</TableCell>
<TableCell>
{data?.pendingStake ? formatSqd(SQD_TOKEN, data?.stake?.amount) : '-'}
{data?.stake ? formatSqd(SQD_TOKEN, data?.stake?.amount) : '-'}
</TableCell>
<TableCell>
<Box display="flex" justifyContent="flex-end">
Expand Down
10 changes: 5 additions & 5 deletions src/pages/WorkersPage/WorkerDelegate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useFormik } from 'formik';
import * as yup from 'yup';

import { useWorkerDelegate } from '@api/contracts/staking';
import { formatSqd, fromSqd, toSqd } from '@api/contracts/utils';
import { formatSqd, fromSqd, humanReadableSqd, toSqd } from '@api/contracts/utils';
import { BlockchainApiWorker } from '@api/subsquid-network-squid';
import { BlockchainContractError } from '@components/BlockchainContractError';
import { ContractCallDialog } from '@components/ContractCallDialog';
Expand Down Expand Up @@ -59,8 +59,8 @@ export function WorkerDelegate({
const formik = useFormik({
initialValues: {
source: '',
amount: 0,
max: 0,
amount: '0',
max: '0',
},
validationSchema: delegateSchema(SQD_TOKEN),
validateOnChange: true,
Expand Down Expand Up @@ -94,7 +94,7 @@ export function WorkerDelegate({
formik.setValues({
...formik.values,
source: source.id,
max: fromSqd(source.balance).toNumber(),
max: humanReadableSqd(source.balance),
});
}, [formik, isSourceLoading, sources]);

Expand Down Expand Up @@ -133,7 +133,7 @@ export function WorkerDelegate({
if (!wallet) return;

formik.setFieldValue('source', wallet.id);
formik.setFieldValue('max', fromSqd(wallet.balance).toNumber());
formik.setFieldValue('max', fromSqd(wallet.balance).toFixed(18));
}}
/>
</FormRow>
Expand Down

0 comments on commit b5876f2

Please sign in to comment.