This commit is contained in:
2026-10-17 22:11:06 +07:00
parent 35e579701a
commit 688d900cdc
13 changed files with 192 additions and 15 deletions
+7 -1
View File
@@ -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) {