up
This commit is contained in:
+7
-1
@@ -73,6 +73,7 @@ export class Online {
|
||||
canCancel: false,
|
||||
games: [],
|
||||
screenId: null,
|
||||
soundEnabled: null,
|
||||
connection: 'disabled',
|
||||
error: '',
|
||||
notice: '',
|
||||
@@ -220,6 +221,7 @@ export class Online {
|
||||
this.generation++
|
||||
this.screen = null
|
||||
this.previous = null
|
||||
this.state.soundEnabled = null
|
||||
this.state.screenId = null
|
||||
this.state.connection = 'disabled'
|
||||
}
|
||||
@@ -489,13 +491,16 @@ export class Online {
|
||||
this.detach()
|
||||
await this.persistSecrets()
|
||||
return
|
||||
case 'sound':
|
||||
case 'sound': {
|
||||
const generation = this.generation
|
||||
if (!this.screen) throw new Error('Сначала подключите управление')
|
||||
await this.api(`/api/screens/${this.screen.id}/sound`, {
|
||||
screenID: this.screen.id,
|
||||
soundEnabled: true,
|
||||
})
|
||||
if (generation === this.generation) this.state.soundEnabled = true
|
||||
return
|
||||
}
|
||||
case 'results':
|
||||
return this.refreshResults()
|
||||
default:
|
||||
@@ -616,6 +621,7 @@ export class Online {
|
||||
if (previous?.music && next.music && next.music.version < previous.music.version)
|
||||
next = { ...next, music: previous.music }
|
||||
this.previous = next
|
||||
this.state.soundEnabled = next.sound
|
||||
if (this.state.connection === 'offline') this.state.error = ''
|
||||
this.state.connection = 'connected'
|
||||
if (!previous && this.initialSound) {
|
||||
|
||||
Reference in New Issue
Block a user