Skip to content

Commit

Permalink
fix: fix type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mehdibha committed Jan 22, 2024
1 parent 22046ec commit e833a00
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/modules/posts/components/create-post-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ export const CreatePostModal = (props: CreatePostModalProps) => {
setImages([]);
await utils.post.infinitePosts.cancel();
utils.post.infinitePosts.setInfiniteData({ limit: 10, search: "" }, (data) => {
if (!data) {
console.log("no data");
if (!data || !userData?.user) {
return data;
}
return {
Expand All @@ -73,6 +72,7 @@ export const CreatePostModal = (props: CreatePostModalProps) => {
comments: [],
createdAt: new Date(),
author: {
id: userData.user.id,
name: userData?.user.name ?? "",
image: userData?.user.image ?? null,
},
Expand Down

0 comments on commit e833a00

Please sign in to comment.