|
|
|
@ -25,17 +25,17 @@ const Post = ({renderedPost, theme, changeTheme}: PostProps) => {
|
|
|
|
async function fetchPost() {
|
|
|
|
async function fetchPost() {
|
|
|
|
setIsLoading(true);
|
|
|
|
setIsLoading(true);
|
|
|
|
|
|
|
|
|
|
|
|
if (renderedPost.ok) {
|
|
|
|
if (renderedPost) {
|
|
|
|
setPost(renderedPost)
|
|
|
|
setPost(renderedPost)
|
|
|
|
setIsLoading(false)
|
|
|
|
setIsLoading(false)
|
|
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (renderedPost.status.toString().startsWith("4")) {
|
|
|
|
if (!Cookies.get('drift-token')) {
|
|
|
|
router.push("/signin")
|
|
|
|
router.push('/signin');
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
setError(renderedPost.statusText)
|
|
|
|
setError('Post Error');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fetchPost()
|
|
|
|
fetchPost()
|
|
|
|
|