Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

use-listen-along

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

use-listen-along - npm Package Compare versions

Comparing version 1.1.9 to 1.1.10

2

dist/use-listen-along.cjs.development.js

@@ -35,3 +35,3 @@ 'use strict';

if (r.track !== track && r.np && !disconnect) {
if (r.track && r.track !== track && r.np && !disconnect) {
fetch('https://api.spotify.com/v1/me/player/play', {

@@ -38,0 +38,0 @@ method: 'PUT',

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useListenAlong=function(t,r,e){var n,s=!1,o=null,a=function(t){var r,e,n,s;return{error:{status:!t.success,message:null==t||null==(r=t.error)?void 0:r.message},np:null==(e=t.data)?void 0:e.listening_to_spotify,track:null==(n=t.data)||null==(s=n.spotify)?void 0:s.track_id}},i=function(t){if(t.error.status)throw new Error(JSON.stringify(t.error));t.track!==n&&t.np&&!e&&fetch("https://api.spotify.com/v1/me/player/play",{method:"PUT",headers:{Authorization:"Bearer "+r,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({uris:["spotify:track:"+t.track]})}).then((function(t){s=204==t.status,o=204!==t.status?403==t.status?"User must have a premium account.":t.statusText:null})).catch((function(t){if(t.status)throw new Error(t)})),n=t.track};return setInterval((function(){e||fetch("https://api.lanyard.rest/v1/users/"+t).then((function(t){return t.json()})).then(a).then(i)}),1e3),{connected:s,error:o}};
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useListenAlong=function(t,r,e){var n,s=!1,o=null,a=function(t){var r,e,n,s;return{error:{status:!t.success,message:null==t||null==(r=t.error)?void 0:r.message},np:null==(e=t.data)?void 0:e.listening_to_spotify,track:null==(n=t.data)||null==(s=n.spotify)?void 0:s.track_id}},i=function(t){if(t.error.status)throw new Error(JSON.stringify(t.error));t.track&&t.track!==n&&t.np&&!e&&fetch("https://api.spotify.com/v1/me/player/play",{method:"PUT",headers:{Authorization:"Bearer "+r,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({uris:["spotify:track:"+t.track]})}).then((function(t){s=204==t.status,o=204!==t.status?403==t.status?"User must have a premium account.":t.statusText:null})).catch((function(t){if(t.status)throw new Error(t)})),n=t.track};return setInterval((function(){e||fetch("https://api.lanyard.rest/v1/users/"+t).then((function(t){return t.json()})).then(a).then(i)}),1e3),{connected:s,error:o}};
//# sourceMappingURL=use-listen-along.cjs.production.min.js.map

@@ -31,3 +31,3 @@ /**

if (r.track !== track && r.np && !disconnect) {
if (r.track && r.track !== track && r.np && !disconnect) {
fetch('https://api.spotify.com/v1/me/player/play', {

@@ -34,0 +34,0 @@ method: 'PUT',

{
"name": "use-listen-along",
"description": "A react hook to listen alongside others on spotify.",
"version": "1.1.9",
"version": "1.1.10",
"license": "MIT",

@@ -6,0 +6,0 @@ "main": "dist/index.js",

@@ -38,3 +38,3 @@ import { LanyardResponse } from './types';

if (r.track !== track && r.np && !disconnect) {
if (r.track && r.track !== track && r.np && !disconnect) {
fetch('https://api.spotify.com/v1/me/player/play', {

@@ -41,0 +41,0 @@ method: 'PUT',

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc