1
1
mirror of https://github.com/srid/ema.git synced 2024-11-25 20:12:20 +03:00

Fix a bug in parent (client not replacing HTML after ghcid reload)

This commit is contained in:
Sridhar Ratnakumar 2021-04-21 15:48:01 -04:00
parent a1c9167b53
commit f1428dc6c1
2 changed files with 6 additions and 5 deletions

View File

@ -98,7 +98,12 @@ addListener v = do
atomically $ do
subs <- readTMVar $ lvarListeners v
let nextIdx = maybe 1 (succ . fst) $ Map.lookupMax subs
notify <- newEmptyTMVar
notify <-
tryReadTMVar (lvarCurrent v) >>= \case
Nothing -> newEmptyTMVar
-- As a value is already available, send that as first notification.
-- FIXME: This may not be desirable; due to unnececessary DOM replacement by websocket client.
Just _ -> newTMVar ()
void $ swapTMVar (lvarListeners v) $ Map.insert nextIdx notify subs
pure nextIdx

View File

@ -128,10 +128,6 @@ wsClientShim =
if(is[i])
document.getElementById('ema-message').innerText = messages[i]
};
console.log(document);
console.log(document.getElementById("ema-indicator"));
console.log(document.getElementById("ema-indicator").style);
console.log(document.getElementById("ema-indicator").style.display);
document.getElementById("ema-indicator").style.display = "block";
};
window.connected = () => setIndicators(true, false, false, false)