Skip to content

Commit

Permalink
Moved hook to prevent error on slower internet
Browse files Browse the repository at this point in the history
  • Loading branch information
EliteAsian123 committed Jul 22, 2023
1 parent de99ad3 commit 5985c82
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/routes/NewsPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ function NewsPage() {
if (!md) return <></>;

const { data, error, isLoading, isSuccess } = useNewsArticle(md);
const navigate = useNavigate();

if (isLoading) return "Loading..";

if (error) return `An error has occurred: ${error}`;

if (isSuccess) {
const { data: articleData, content } = matter(data);
const navigate = useNavigate();

let videoElem = <></>;
if ("video" in articleData) {
Expand Down

0 comments on commit 5985c82

Please sign in to comment.