Skip to content

Commit

Permalink
Merge pull request #98 from ethpandaops/fix/block-version-case
Browse files Browse the repository at this point in the history
fix(web): block version case matching
  • Loading branch information
Savid authored Feb 17, 2023
2 parents 7fa03a4 + 9cbf116 commit 5914e91
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web/src/parts/slot/Slot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function Slot(props: { slot: number }) {
return res.json();
});
const block = useMemo<APIBeaconBlockMessage | undefined>(() => {
switch (data?.data?.block?.Version) {
switch (data?.data?.block?.Version?.toUpperCase()) {
case 'ALTAIR':
return data?.data?.block?.Altair;
case 'BELLATRIX':
Expand All @@ -37,7 +37,7 @@ export default function Slot(props: { slot: number }) {
}
}, [data]);
const blockHash = useMemo(() => {
if (['ALTAIR', 'PHASE0'].includes(data?.data?.block?.Version ?? '')) {
if (['ALTAIR', 'PHASE0'].includes(data?.data?.block?.Version?.toUpperCase() ?? '')) {
return block?.message?.body?.eth1_data?.block_hash;
}
return (
Expand Down

0 comments on commit 5914e91

Please sign in to comment.