Skip to content

Commit

Permalink
fix:fixed eslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ab3MN committed Nov 14, 2024
1 parent f475627 commit 1af97d2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
13 changes: 8 additions & 5 deletions src/context/PostContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,14 @@ export const PostsProvider = ({
const [selectedPost, setSelectedPost] = useState<Post | null>(null);
const { posts, postsError, isLoadingPosts } = usePosts(selectedUser);

const handleSelectUser = useCallback((user: User) => {
setUserMenuOpen(false);
setSelectedUser(user);
setSelectedPost(null);
}, []);
const handleSelectUser = useCallback(
(user: User) => {
setUserMenuOpen(false);
setSelectedUser(user);
setSelectedPost(null);
},
[setSelectedUser, setUserMenuOpen],
);

const store = useMemo(
() => ({
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/useComments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export const useComments = (postId: number) => {
setError('Fetch comments with error');
}
})
.catch((error: Error) => {
setError(error.message);
.catch((err: Error) => {
setError(err.message);
});
};

Expand Down

0 comments on commit 1af97d2

Please sign in to comment.