Skip to content

Commit

Permalink
focus fix
Browse files Browse the repository at this point in the history
added a fix to restore focus after focus lost, to update the widget
  • Loading branch information
fluffy-git committed Nov 14, 2023
1 parent 7fb3916 commit f417a97
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions spotinfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ var songData, progressSeconds, totalSeconds, progressInterval;

const sleep = ms => new Promise(r => setTimeout(r, ms));

document.addEventListener('focusin', updatePlayer);

function updatePlayer() {
fetch(`${serviceHost}/get-now-playing`)
.then((response) => response.json())
Expand Down

0 comments on commit f417a97

Please sign in to comment.