mirror of
https://github.com/koel/koel
synced 2024-11-10 14:44:13 +00:00
Fix JS styles
This commit is contained in:
parent
1dea2d87c6
commit
05888b0b62
4 changed files with 14 additions and 14 deletions
|
@ -150,7 +150,7 @@ export default {
|
|||
*/
|
||||
like () {
|
||||
if (this.song.id) {
|
||||
favoriteStore.toggleOne(this.song)
|
||||
favoriteStore.toggleOne(this.song)
|
||||
socket.broadcast('song', songStore.generateDataToBroadcast(this.song))
|
||||
}
|
||||
},
|
||||
|
|
|
@ -78,7 +78,7 @@
|
|||
this.init()
|
||||
},
|
||||
|
||||
async init() {
|
||||
async init () {
|
||||
try {
|
||||
const user = await userStore.getProfile()
|
||||
userStore.init([], user)
|
||||
|
@ -102,7 +102,7 @@
|
|||
|
||||
toggleFavorite () {
|
||||
if (!this.song) {
|
||||
return;
|
||||
return
|
||||
}
|
||||
|
||||
this.song.liked = !this.song.liked
|
||||
|
@ -125,12 +125,12 @@
|
|||
socket.broadcast('playback:prev')
|
||||
},
|
||||
|
||||
getStatus() {
|
||||
getStatus () {
|
||||
socket.broadcast('song:getcurrent')
|
||||
},
|
||||
|
||||
/**
|
||||
* As iOS will put a web app into standby/sleep mode (and halt all JS execution),
|
||||
* As iOS will put a web app into standby/sleep mode (and halt all JS execution),
|
||||
* this method will keep track of the last active time and keep the status always fresh.
|
||||
*/
|
||||
heartbeat () {
|
||||
|
|
|
@ -106,8 +106,8 @@ export const playback = {
|
|||
.listen('playback:prev', () => this.playPrev())
|
||||
.listen('song:getcurrent', () => {
|
||||
socket.broadcast(
|
||||
'song',
|
||||
queueStore.current
|
||||
'song',
|
||||
queueStore.current
|
||||
? songStore.generateDataToBroadcast(queueStore.current)
|
||||
: { song: null }
|
||||
)
|
||||
|
@ -154,7 +154,7 @@ export const playback = {
|
|||
/**
|
||||
* Show the "now playing" notification for a song.
|
||||
*
|
||||
* @param {Object} song
|
||||
* @param {Object} song
|
||||
*/
|
||||
showNotification (song) {
|
||||
// Show the notification if we're allowed to
|
||||
|
|
|
@ -17,13 +17,13 @@ export const socket = {
|
|||
authEndpoint: '/api/broadcasting/auth',
|
||||
auth: {
|
||||
headers: {
|
||||
Authorization: `Bearer ${ls.get('jwt-token')}`
|
||||
Authorization: `Bearer ${ls.get('jwt-token')}`
|
||||
}
|
||||
},
|
||||
cluster: process.env.PUSHER_APP_CLUSTER,
|
||||
encrypted: true
|
||||
})
|
||||
|
||||
|
||||
this.channel = this.pusher.subscribe('private-koel')
|
||||
this.channel.bind('pusher:subscription_succeeded', () => {
|
||||
return resolve()
|
||||
|
@ -39,7 +39,7 @@ export const socket = {
|
|||
* @param {string} eventName The event's name
|
||||
* @param {Object} data The event's data
|
||||
*/
|
||||
broadcast(eventName, data = {}) {
|
||||
broadcast (eventName, data = {}) {
|
||||
this.channel && this.channel.trigger(`client-${eventName}.${userStore.current.id}`, data)
|
||||
|
||||
return this
|
||||
|
@ -48,11 +48,11 @@ export const socket = {
|
|||
/**
|
||||
* Listen to an event.
|
||||
* @param {string} eventName The event's name
|
||||
* @param {Function} cb
|
||||
* @param {Function} cb
|
||||
*/
|
||||
listen(eventName, cb) {
|
||||
listen (eventName, cb) {
|
||||
this.channel && this.channel.bind(`client-${eventName}.${userStore.current.id}`, data => cb(data))
|
||||
|
||||
|
||||
return this
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue