We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0e36eba commit e62663aCopy full SHA for e62663a
src/lib/spotify.ts
@@ -28,9 +28,13 @@ const IFrameAPI = shallowRef<IFrameAPI>();
28
window.onSpotifyIframeApiReady = api => {
29
IFrameAPI.value = api;
30
};
31
-const { load: loadSpotify } = useScriptTag('https://open.spotify.com/embed/iframe-api/v1', () => {}, { manual: true });
32
-loadSpotify();
+let spotifyLoaded = false;
33
34
export function useSpotifyIFrameAPI() {
+ if (!spotifyLoaded) {
35
+ spotifyLoaded = true;
36
+ const { load: loadSpotify } = useScriptTag('https://open.spotify.com/embed/iframe-api/v1', () => {}, { manual: true });
37
+ loadSpotify(false);
38
+ }
39
return IFrameAPI;
40
}
0 commit comments