1
1
mirror of https://github.com/srid/ema.git synced 2024-11-29 09:25:14 +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 atomically $ do
subs <- readTMVar $ lvarListeners v subs <- readTMVar $ lvarListeners v
let nextIdx = maybe 1 (succ . fst) $ Map.lookupMax subs 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 void $ swapTMVar (lvarListeners v) $ Map.insert nextIdx notify subs
pure nextIdx pure nextIdx

View File

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