properly check for scrobbles support

This commit is contained in:
Henry Jameson 2025-06-28 21:23:41 +03:00
commit 5cafdca855

View file

@ -110,17 +110,17 @@ const sortTimeline = (timeline) => {
}
const getLatestScrobble = (state, user) => {
const scrobbles = state.pleromaScrobblesAvailable
if (!scrobbles) return
const scrobblesSupport = state.pleromaScrobblesAvailable
if (!scrobblesSupport) return
if (state.scrobblesNextFetch[user.id] && state.scrobblesNextFetch[user.id] > Date.now()) {
return
}
state.scrobblesNextFetch[user.id] = Date.now() + 24 * 60 * 60 * 1000
if (!scrobbles) return
if (!scrobblesSupport) return
apiService.fetchScrobbles({ accountId: user.id }).then((scrobbles) => {
if (scrobbles?.error?.status === 501) {
if (scrobbles?.error) {
state.pleromaScrobblesAvailable = false
return
}