Skip to content

Commit

Permalink
fix: block component block not available yet (#745)
Browse files Browse the repository at this point in the history
During a regression test after [ctypehub/pull/743](#743), it was found that the "Registration Block" component was showing a broken link after creating a cType from inside the app. This was because the block was still not available and the link required the block number.

Now: 

- The component will direct to the polkadot.js explorer (without querying a specific block) when block number is undefined. 
Reverted: - ~When submitting a cType creation transaction, it will be awaited until it is _InBlock_.~

## Other fix: 
Handle cTypes without a title.
  • Loading branch information
kilted-andres authored Sep 11, 2024
1 parent a026723 commit 3f5c56f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/components/CTypeDetails/CTypeDetails.astro
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ linkToW3N.pathname = web3Name ?? creator;
const linkToBlock = new URL(`https://polkadot.js.org/apps/`);
linkToBlock.searchParams.set('rpc', blockchainEndpoint);
linkToBlock.hash = `/explorer/query/${block}`;
linkToBlock.hash = `/explorer/${block ? 'query/' + block : ''}`;
---

<section class={containerStyles.bigContainer}>
Expand Down Expand Up @@ -99,9 +99,7 @@ linkToBlock.hash = `/explorer/query/${block}`;
<fieldset>
<legend>Registration Block</legend>

<a href={linkToBlock}>
{block}
</a>
<a href={linkToBlock}>{block}</a>
</fieldset>

{
Expand Down
2 changes: 1 addition & 1 deletion src/components/CTypeOverview/CTypeOverview.astro
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const { title, id, description, attestationsCreated, tags } =
<li class=`${containerStyles.container} container`>
<h2>
<a href={generatePath(paths.ctypeDetails, id)} class="title">
{title}
{title || ''}
</a>
</h2>

Expand Down

0 comments on commit 3f5c56f

Please sign in to comment.