fix(player): reduce average CPU usage from 100% to 20%

Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2346>
This commit is contained in:
Kasper Seweryn 2023-03-06 21:20:37 +01:00 committed by Marge
parent 87c9eb3982
commit 05db380766
1 changed files with 3 additions and 1 deletions

View File

@ -179,7 +179,9 @@ export const usePlayer = createGlobalState(() => {
? progress
: 0
document.documentElement.style.setProperty('--fw-track-progress', `${lastProgress}%`)
for (const bar of document.querySelectorAll<HTMLElement>('.ui.progress .position.bar')) {
bar.style.setProperty('--fw-track-progress', `${lastProgress}%`)
}
}
})