fix oxlint warnings (#26634)

This commit is contained in:
Asuka Minato
2025-10-09 10:23:34 +09:00
committed by GitHub
parent c4d8bf0ce9
commit a8746bff30
76 changed files with 261 additions and 144 deletions

View File

@@ -127,7 +127,7 @@ export default class AudioPlayer {
}
catch {
this.isLoadData = false
this.callback && this.callback('error')
this.callback?.('error')
}
}
@@ -137,15 +137,14 @@ export default class AudioPlayer {
if (this.audioContext.state === 'suspended') {
this.audioContext.resume().then((_) => {
this.audio.play()
this.callback && this.callback('play')
this.callback?.('play')
})
}
else if (this.audio.ended) {
this.audio.play()
this.callback && this.callback('play')
this.callback?.('play')
}
if (this.callback)
this.callback('play')
this.callback?.('play')
}
else {
this.isLoadData = true
@@ -189,24 +188,24 @@ export default class AudioPlayer {
if (this.audio.paused) {
this.audioContext.resume().then((_) => {
this.audio.play()
this.callback && this.callback('play')
this.callback?.('play')
})
}
else if (this.audio.ended) {
this.audio.play()
this.callback && this.callback('play')
this.callback?.('play')
}
else if (this.audio.played) { /* empty */ }
else {
this.audio.play()
this.callback && this.callback('play')
this.callback?.('play')
}
}
}
public pauseAudio() {
this.callback && this.callback('paused')
this.callback?.('paused')
this.audio.pause()
this.audioContext.suspend()
}