Patching onmessage from ReactDev tools; Genius auth

This commit is contained in:
James Barnsley
2018-08-16 08:05:06 +12:00
parent b7eb12b4f5
commit 240ebf9391
12 changed files with 958 additions and 3856 deletions

View File

@ -24,7 +24,12 @@ class SpotifyAuthenticationFrame extends React.Component{
// Listen for incoming messages from the authorization popup
window.addEventListener('message', function(event){
var data = JSON.parse(event.data);
try {
var data = JSON.parse(event.data);
} catch (e){
console.error("Failed to parse JSON", e, event);
return;
}
// Only digest messages relevant to us
if (data.origin == 'auth_spotify'){