mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2026-09-08 20:25:34 -04:00
wrap hit counter with an error boundary in case the API falls on its face again
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { ErrorBoundary } from "react-error-boundary";
|
||||
import Link from "../Link";
|
||||
import Time from "../Time";
|
||||
import HitCounter from "../HitCounter";
|
||||
@@ -106,8 +107,11 @@ const NoteMeta = ({ slug, date, title, htmlTitle, tags }: NoteMetaProps) => {
|
||||
marginRight: 0,
|
||||
}}
|
||||
>
|
||||
<Icon as={FiEye} />
|
||||
<HitCounter slug={`notes/${slug}`} />
|
||||
{/* completely hide this block if anything goes wrong on the backend */}
|
||||
<ErrorBoundary fallback={null}>
|
||||
<Icon as={FiEye} />
|
||||
<HitCounter slug={`notes/${slug}`} />
|
||||
</ErrorBoundary>
|
||||
</MetaItem>
|
||||
)}
|
||||
</Wrapper>
|
||||
|
||||
Reference in New Issue
Block a user