From f417a972e1e1b4c5a29b8bbf493b1d1f04ca84cb Mon Sep 17 00:00:00 2001 From: fluffy <69675847+fluffy-git@users.noreply.github.com> Date: Tue, 14 Nov 2023 11:46:31 +0100 Subject: [PATCH] focus fix added a fix to restore focus after focus lost, to update the widget --- spotinfo.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spotinfo.js b/spotinfo.js index 1e76a69..3153c26 100644 --- a/spotinfo.js +++ b/spotinfo.js @@ -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())