Browse Source

Remove window refetch on playlist

master
jeffvli 3 years ago
parent
commit
e8ad1f9803
  1. 8
      src/components/playlist/PlaylistView.tsx

8
src/components/playlist/PlaylistView.tsx

@ -72,9 +72,7 @@ const PlaylistView = ({ ...rest }) => {
const { isLoading, isError, data, error }: any = useQuery(
['playlist', playlistId],
() => getPlaylist(playlistId),
{
refetchOnWindowFocus: multiSelect.selected.length < 1 || !isModified,
}
{ refetchOnWindowFocus: false }
);
const [editName, setEditName] = useState('');
const [editDescription, setEditDescription] = useState('');
@ -294,7 +292,7 @@ const PlaylistView = ({ ...rest }) => {
<SaveButton
size="lg"
text={needsRecovery ? 'Recover playlist' : undefined}
color={needsRecovery ? 'red' : isModified ? 'green' : undefined}
color={needsRecovery ? 'red' : undefined}
disabled={
(!needsRecovery && !isModified) ||
misc.isProcessingPlaylist.includes(data?.id)
@ -304,7 +302,7 @@ const PlaylistView = ({ ...rest }) => {
/>
<UndoButton
size="lg"
color={needsRecovery ? 'red' : isModified ? 'green' : undefined}
color={needsRecovery ? 'red' : undefined}
disabled={
needsRecovery || !isModified || misc.isProcessingPlaylist.includes(data?.id)
}

Loading…
Cancel
Save