Merge pull request #527 from tezvii/main

Fix for visually broken Repeat button
This commit is contained in:
Samidy 2026-04-07 20:01:46 +03:00 committed by GitHub
commit 625b80ff64
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -585,7 +585,7 @@ export function initializePlayerEvents(player, audioPlayer, scrobbler, ui) {
repeatBtn.addEventListener('click', async () => {
await hapticLight();
const mode = player.toggleRepeat();
const mode = await player.toggleRepeat();
trackToggleRepeat(mode === REPEAT_MODE.OFF ? 'off' : mode === REPEAT_MODE.ALL ? 'all' : 'one');
repeatBtn.classList.toggle('active', mode !== REPEAT_MODE.OFF);
repeatBtn.classList.toggle('repeat-one', mode === REPEAT_MODE.ONE);

View file

@ -2024,8 +2024,8 @@ export class UIRenderer {
shuffleBtn.classList.toggle('active', this.player.shuffleActive);
};
repeatBtn.onclick = () => {
const mode = this.player.toggleRepeat();
repeatBtn.onclick = async () => {
const mode = await this.player.toggleRepeat();
repeatBtn.classList.toggle('active', mode !== 0);
if (mode === 2) {
repeatBtn.innerHTML = SVG_REPEAT_ONE(24);