Skip to content

Commit

Permalink
fix: update bookmarks cache after move
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamedSaidSallam committed Feb 7, 2022
1 parent 81cb5ff commit 866a45c
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions components/Bookmarks/MoveBookmarkButtons.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,24 @@ const MoveBookmarkButtons = ({
queryClient.setQueryData(
getBookmarksFolderQueryKey(
store.profileId,
inRootBookmark ? undefined : fromBookmarkId
undefined
),
(oldData) => ({
...oldData,
posts: oldData.posts.filter((item) => item.id !== postId),
})
(oldData) =>
oldData && {
...oldData,
posts: oldData.posts.filter((item) => item.id !== postId),
}
);
queryClient.setQueryData(
getBookmarksFolderQueryKey(
store.profileId,
fromBookmarkId
),
(oldData) =>
oldData && {
...oldData,
posts: oldData.posts.filter((item) => item.id !== postId),
}
);
queryClient.setQueryData(
getBookmarksFolderQueryKey(
Expand Down

0 comments on commit 866a45c

Please sign in to comment.