Skip to content
This repository was archived by the owner on Feb 7, 2022. It is now read-only.

Commit 18db939

Browse files
committed
connect player button modified
clearer button label connect button plays automatically
1 parent 5cabb8f commit 18db939

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/components/Player/index.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,11 @@ export const Player = observer((props) => {
138138
{!device_connected && (
139139
<div className={styles.connectSpotify}>
140140
<button
141-
onClick={() => playerStore.connectToPlayer(playerStore.device_id)}
141+
onClick={() =>
142+
playerStore.connectToPlayer(playerStore.device_id, true)
143+
}
142144
>
143-
Connect Spotify
145+
Click to connect Spotify
144146
</button>
145147
</div>
146148
)}

src/stores/playerStore.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ export class PlayerStore {
517517
});
518518
});
519519

520-
connectToPlayer = async (device_id) => {
520+
connectToPlayer = async (device_id, play = false) => {
521521
// get current access token
522522
// TODO: error handling
523523
let access_token;
@@ -532,7 +532,7 @@ export class PlayerStore {
532532
`https://api.spotify.com/v1/me/player`,
533533
{
534534
device_ids: [device_id],
535-
play: false,
535+
play: play,
536536
},
537537
{
538538
headers: {

0 commit comments

Comments
 (0)