Skip to content

Commit

Permalink
Remove random delay from frontend refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
jaedolph committed May 28, 2024
1 parent 4d495fa commit 1a4962d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions frontend/panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ htmx.on('htmx:configRequest', (e) => {
twitch.listen('broadcast', function (target, contentType, message) {
// handle refreshing the panel if the streamer updates the layout
if (message === 'refresh') {
// refresh after a random interval between 0-5s (to reduce EBS load)
setTimeout(function () {
htmx.trigger('#layout-loader', 'refresh')
}, Math.floor(Math.random() * 5000))
htmx.trigger('#layout-loader', 'refresh')
}
})

Expand Down

0 comments on commit 1a4962d

Please sign in to comment.