, if the time taken by the user exceeds the expiry time of the accessToken, the playlist cannot be created. A 401 access token expired response is received from the Spotify API.
The user needs to refresh the page to update the app state so its sees/gets a fresh accessToken, and this means the playlist selections are lost.
Workaround: create the playlist in smaller chunks to avoid exceeding the accessToken expiry time.
Solution?
If the token expires, refresh it and try again?
Example of creating a playlist
The problem
LocalStorage data
handleCreatePlaylist looks like the first function that is called in the stack?