Merge pull request #527 from tezvii/main
Fix for visually broken Repeat button
This commit is contained in:
commit
625b80ff64
2 changed files with 3 additions and 3 deletions
|
|
@ -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);
|
||||
|
|
|
|||
4
js/ui.js
4
js/ui.js
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue