A decentralized music tracking and discovery platform built on AT Protocol 🎵 rocksky.app
spotify atproto lastfm musicbrainz scrobbling listenbrainz
99
fork

Configure Feed

Select the types of activity you want to include in your feed.

Disable structural sharing and simplify query updates

Turn off React Query's structural sharing for now-playings so new arrays
are treated as changes. Also pass values directly to setQueryData for
now-playings and scrobblesChart instead of updater functions.

+3 -7
+1
apps/web/src/hooks/useNowPlaying.tsx
··· 25 { params: { size: 47 } }, 26 ), 27 select: (res) => res.data.nowPlayings || [], 28 });
··· 25 { params: { size: 47 } }, 26 ), 27 select: (res) => res.data.nowPlayings || [], 28 + structuralSharing: false, 29 });
+2 -7
apps/web/src/pages/home/feed/Feed.tsx
··· 74 } 75 76 const message = JSON.parse(event.data); 77 - queryClient.setQueryData(["now-playings"], () => [ 78 - ...message.nowPlayings, 79 - ]); 80 - queryClient.setQueryData( 81 - ["scrobblesChart"], 82 - () => message.scrobblesChart, 83 - ); 84 85 await queryClient.invalidateQueries({ 86 queryKey: ["infiniteFeed", feedUri],
··· 74 } 75 76 const message = JSON.parse(event.data); 77 + queryClient.setQueryData(["now-playings"], [...message.nowPlayings]); 78 + queryClient.setQueryData(["scrobblesChart"], message.scrobblesChart); 79 80 await queryClient.invalidateQueries({ 81 queryKey: ["infiniteFeed", feedUri],