🐛 (spotify) try to fix the bug when we want to resume but the token is invalid
This commit is contained in:
@@ -56,6 +56,9 @@ export const useSpotify = (onPlay: () => void, onPause: () => void) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const play = async () => {
|
const play = async () => {
|
||||||
|
if (!hasValidAccessToken.value) {
|
||||||
|
redirectToSpotifyConnect()
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
if (spotify.player && ready.value) {
|
if (spotify.player && ready.value) {
|
||||||
const playerState = await spotify.player.getCurrentState()
|
const playerState = await spotify.player.getCurrentState()
|
||||||
@@ -68,6 +71,7 @@ export const useSpotify = (onPlay: () => void, onPause: () => void) => {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.warn(error)
|
console.warn(error)
|
||||||
|
redirectToSpotifyConnect()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user