Skip to content

Commit

Permalink
fix(status-page): Status block proven (#13150)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberhorsey committed Feb 14, 2023
1 parent ca47015 commit 21e62fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/status-page/src/components/StatusIndicator.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
export let colorFunc: (value: Status) => string;
export let onClick: (value: Status) => void = null;
export let onClick: (value: Status) => void;
export let header: string;
Expand Down Expand Up @@ -89,7 +89,7 @@
<span
transition:fade
class="pt-2 inline-block align-bottom {onClick ? 'cursor-pointer' : ''}"
on:click={() => onClick(statusValue)}
on:click={() => (onClick ? onClick(statusValue) : "")}
>
<span class={colorFunc(statusValue)}>
{displayStatusValue(statusValue)}
Expand Down
5 changes: 2 additions & 3 deletions packages/status-page/src/pages/home/Home.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,7 @@
) => {
const contract = new Contract(address, TaikoL1, provider);
contract.on("BlockProven", (id, parentHash, blockHash, timestamp) => {
console.log("block proven", timestamp);
onEvent(new Date(timestamp).toString());
onEvent(new Date(timestamp.toNumber() * 1000).toString());
});
},
colorFunc: function (status: Status) {
Expand Down Expand Up @@ -284,7 +283,7 @@
address: string
) => {
const stateVars = await getStateVariables(provider, address);
return stateVars.avgBlockTime.toNumber();
return `${stateVars.avgBlockTime.toNumber()} seconds`;
},
tooltip:
"The current average block time, updated when a block is successfully proposed.",
Expand Down

0 comments on commit 21e62fd

Please sign in to comment.