From e646df43f2c0c2791da1c49d34812887af80dd3b Mon Sep 17 00:00:00 2001 From: Anton <62949848+icepaq@users.noreply.github.com> Date: Wed, 16 Mar 2022 19:21:22 -0400 Subject: [PATCH] clean up post check --- client/pages/post/[id].tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/pages/post/[id].tsx b/client/pages/post/[id].tsx index b523d688..374130f7 100644 --- a/client/pages/post/[id].tsx +++ b/client/pages/post/[id].tsx @@ -25,17 +25,17 @@ const Post = ({renderedPost, theme, changeTheme}: PostProps) => { async function fetchPost() { setIsLoading(true); - if (renderedPost.ok) { + if (renderedPost) { setPost(renderedPost) setIsLoading(false) return; } - if (renderedPost.status.toString().startsWith("4")) { - router.push("/signin") + if (!Cookies.get('drift-token')) { + router.push('/signin'); } else { - setError(renderedPost.statusText) + setError('Post Error'); } } fetchPost()