diff --git a/client/src/components/post/like/CommentLikes.tsx b/client/src/components/post/like/CommentLikes.tsx index a5bbab2..3feb091 100644 --- a/client/src/components/post/like/CommentLikes.tsx +++ b/client/src/components/post/like/CommentLikes.tsx @@ -6,7 +6,7 @@ import { Like, LikePostRequest } from "../../../interfaces/interfaces"; import { getAuthorIdFromResponse, getCodeFromObjectId, - isApiPathNoSlash, + isApiPathNoSlash, isHostLocal, isUrlIdLocal } from "../../../utils/responseUtils"; import { toast } from "react-toastify"; @@ -26,8 +26,7 @@ const CommentLikes = ({ }) => { const [commentLikes, setCommentLikes] = useState([]); const [isUserLiked, setIsUserLiked] = useState(false); - const isLocal = isUrlIdLocal(comment.id); - const commentId = getAuthorIdFromResponse(comment.id); + const isLocal = isHostLocal(comment.author.host); const userData = getUserData(); const handleLike = async () => { diff --git a/client/src/components/post/like/PostLikes.tsx b/client/src/components/post/like/PostLikes.tsx index 57d99c7..cc0f9c4 100644 --- a/client/src/components/post/like/PostLikes.tsx +++ b/client/src/components/post/like/PostLikes.tsx @@ -23,7 +23,6 @@ const PostLikes = ({ }) => { const [postLikes, setPostLikes] = useState([]); const [isUserLiked, setIsUserLiked] = useState(false); - const postId = getAuthorIdFromResponse(post.id); const isLocal = isHostLocal(post.author.host); const userData = getUserData();