fix(showcase): fixed an error where music cannot be played when custom background is used

This commit is contained in:
Haoyu Xu
2024-02-03 23:33:36 +08:00
parent 6d2377dc1f
commit 2d185c1040

View File

@@ -81,7 +81,7 @@ export default class Music {
}
changeMusic(name) {
if (name !== this.#currentMusic && !this.#isUsingCustomMusic) {
if (name !== null && name !== this.#currentMusic && !this.#isUsingCustomMusic) {
this.#currentMusic = name
if (this.#useMusic) {
this.#audioLoopEl.pause()