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

fix(status-page): Status block proven #13150

Merged
merged 2 commits into from
Feb 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
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