Skip to content

Commit

Permalink
fix: use correct onerror() handler
Browse files Browse the repository at this point in the history
  • Loading branch information
Symbitic committed Jun 10, 2021
1 parent 0a5c2ba commit 5749953
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/spotify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const EMPTY_TRACK: SpotifyPlayerTrack = {
};

/** @hidden */
function loadSpotifyPlayer(): Promise<any> {
function loadSpotifyPlayer(): Promise<void> {
return new Promise<void>((resolve, reject) => {
const scriptTag = document.getElementById('spotify-player');

Expand All @@ -38,8 +38,7 @@ function loadSpotifyPlayer(): Promise<any> {
script.defer = true;
script.src = 'https://sdk.scdn.co/spotify-player.js';
script.onload = () => resolve();
script.onerror = (error: any) =>
reject(new Error(`loadScript: ${error.message}`));
script.onerror = () => reject(new Error('Error loading spotify-player.js'));

document.head.appendChild(script);
} else {
Expand Down

0 comments on commit 5749953

Please sign in to comment.