From 2923ef2de9fbcc1577cc6910ce03d6cd06b0fa95 Mon Sep 17 00:00:00 2001 From: jeffvli Date: Tue, 5 Oct 2021 18:39:33 -0700 Subject: [PATCH] Change to local update when editing playlist --- src/components/playlist/PlaylistView.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/playlist/PlaylistView.tsx b/src/components/playlist/PlaylistView.tsx index e1abe78..0612d0b 100644 --- a/src/components/playlist/PlaylistView.tsx +++ b/src/components/playlist/PlaylistView.tsx @@ -262,8 +262,8 @@ const PlaylistView = ({ ...rest }) => { if (isFailedResponse(res)) { notifyToast('error', errorMessages(res)[0]); } else { - queryClient.refetchQueries(['playlist'], { - active: true, + queryClient.setQueryData(['playlist', playlistId], (oldData: any) => { + return { ...oldData, name: editName, comment: editDescription, public: editPublic }; }); }