properly check for scrobbles support
This commit is contained in:
parent
ec367ad761
commit
5cafdca855
1 changed files with 4 additions and 4 deletions
|
|
@ -110,17 +110,17 @@ const sortTimeline = (timeline) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const getLatestScrobble = (state, user) => {
|
const getLatestScrobble = (state, user) => {
|
||||||
const scrobbles = state.pleromaScrobblesAvailable
|
const scrobblesSupport = state.pleromaScrobblesAvailable
|
||||||
if (!scrobbles) return
|
if (!scrobblesSupport) return
|
||||||
|
|
||||||
if (state.scrobblesNextFetch[user.id] && state.scrobblesNextFetch[user.id] > Date.now()) {
|
if (state.scrobblesNextFetch[user.id] && state.scrobblesNextFetch[user.id] > Date.now()) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
state.scrobblesNextFetch[user.id] = Date.now() + 24 * 60 * 60 * 1000
|
state.scrobblesNextFetch[user.id] = Date.now() + 24 * 60 * 60 * 1000
|
||||||
if (!scrobbles) return
|
if (!scrobblesSupport) return
|
||||||
apiService.fetchScrobbles({ accountId: user.id }).then((scrobbles) => {
|
apiService.fetchScrobbles({ accountId: user.id }).then((scrobbles) => {
|
||||||
if (scrobbles?.error?.status === 501) {
|
if (scrobbles?.error) {
|
||||||
state.pleromaScrobblesAvailable = false
|
state.pleromaScrobblesAvailable = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue