Skip to content

Commit 684077e

Browse files
committed
fix: use new recentlyPlayed response
1 parent f6d1a80 commit 684077e

File tree

2 files changed

+2
-18
lines changed

2 files changed

+2
-18
lines changed

src/hooks/useSpotifyData.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ export function useSpotifyData(activeSection, skipInitialFetch = false) {
158158
getUserTopArtists,
159159
getUserTracks,
160160
getRecentlyPlayed,
161-
getNextRecentlyPlayed,
162161
getUserShows,
163162
getPlayerState,
164163
getPlaylist,
@@ -290,8 +289,7 @@ export function useSpotifyData(activeSection, skipInitialFetch = false) {
290289
}
291290
}
292291

293-
const params = { limit: 30, additional_types: "track,episode" };
294-
const data = await getRecentlyPlayed(params);
292+
const data = await getRecentlyPlayed();
295293
const uniqueAlbums = [];
296294
const albumIds = new Set();
297295

src/hooks/useSpotifyWebSocket.js

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ export function useSpotifyWebSocket() {
622622
);
623623

624624
const getRecentlyPlayed = useCallback(
625-
async (params = { limit: 30, additional_types: "track,episode" }) => {
625+
async (params = {}) => {
626626
try {
627627
setIsLoading(true);
628628
setError(null);
@@ -642,19 +642,6 @@ export function useSpotifyWebSocket() {
642642
[sendSpotifyCommand],
643643
);
644644

645-
const getNextRecentlyPlayed = useCallback(
646-
async (afterTimestamp, additionalParams = {}) => {
647-
const params = {
648-
limit: 30,
649-
additional_types: "track,episode",
650-
after: afterTimestamp,
651-
...additionalParams,
652-
};
653-
return getRecentlyPlayed(params);
654-
},
655-
[getRecentlyPlayed],
656-
);
657-
658645
const checkIsTrackSaved = useCallback(
659646
async (trackId) => {
660647
try {
@@ -975,7 +962,6 @@ export function useSpotifyWebSocket() {
975962
getUserProfile,
976963
getUserTracks,
977964
getRecentlyPlayed,
978-
getNextRecentlyPlayed,
979965
checkIsTrackSaved,
980966
saveTrack,
981967
removeTrack,

0 commit comments

Comments
 (0)