🐛 (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 () => {
|
||||
if (!hasValidAccessToken.value) {
|
||||
redirectToSpotifyConnect()
|
||||
}
|
||||
try {
|
||||
if (spotify.player && ready.value) {
|
||||
const playerState = await spotify.player.getCurrentState()
|
||||
@@ -68,6 +71,7 @@ export const useSpotify = (onPlay: () => void, onPause: () => void) => {
|
||||
}
|
||||
} catch (error) {
|
||||
console.warn(error)
|
||||
redirectToSpotifyConnect()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user