Skip to content

Commit

Permalink
fix: cid
Browse files Browse the repository at this point in the history
  • Loading branch information
HuberTRoy committed Nov 29, 2023
1 parent 9ea9f9e commit 7b21303
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/pages/consumer/MyFlexPlans/MyHostedPlan/MyHostedPlan.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import CreateHostingFlexPlan, {
CreateHostingFlexPlanRef,
} from '@pages/explorer/FlexPlans/CreateHostingPlan/CreateHostingPlan';
import { Typography } from '@subql/components';
import { bytes32ToCid } from '@subql/network-clients';
import { formatSQT } from '@subql/react-hooks';
import { TOKEN } from '@utils';
import { Table } from 'antd';
Expand Down Expand Up @@ -46,7 +47,10 @@ const MyHostedPlan: FC = (props) => {
const res = await getHostingPlanApi();
const allMetadata = await Promise.allSettled(
res.data.map((i) => {
return getMetadataFromCid(i.project.metadata);
const cid = i.project.metadata.startsWith('Qm')
? i.project.metadata
: bytes32ToCid(`0x${i.project.metadata}`);
return getMetadataFromCid(cid);
}),
);
setCreatedHostingPlan(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ const CreateHostingFlexPlan = forwardRef<
onClick={() => {
setShowCreateFlexPlan(true);
}}
disabled={formatEther(balance, 4) === '0.0'}
disabled={formatEther(balance, 4) === '0.0' || !hasLogin}
>
{t('flexPlans.createFlexPlan')}
</Button>
Expand Down

0 comments on commit 7b21303

Please sign in to comment.