Browse Source

Add undefined check for scrobble

master
jeffvli 3 years ago
committed by Jeff
parent
commit
9f13377f24
  1. 14
      src/components/player/Player.tsx

14
src/components/player/Player.tsx

@ -472,13 +472,15 @@ const Player = ({ currentEntryList, children }: any, ref: any) => {
setScrobbled(false); setScrobbled(false);
if (playQueue.scrobble) { if (playQueue.scrobble) {
if (playerNumber === 1) { if (playerNumber === 1) {
if (playQueue[currentEntryList][playQueue.player1.index]?.id) {
scrobble({
id: playQueue[currentEntryList][playQueue.player1.index]?.id,
submission: false,
});
}
} else if (playQueue[currentEntryList][playQueue.player2.index]?.id) {
scrobble({ scrobble({
id: playQueue[currentEntryList][playQueue.player1.index].id, id: playQueue[currentEntryList][playQueue.player2.index]?.id,
submission: false,
});
} else {
scrobble({
id: playQueue[currentEntryList][playQueue.player2.index].id,
submission: false, submission: false,
}); });
} }

Loading…
Cancel
Save