From 0ff91d1803f10dd4c5caedb740d5f2022411a5d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sun, 11 Oct 2026 11:15:07 +0200 Subject: Fix getLocalHeadCache in ReaderT MonadHead instance Changelog: Fixed status indicator for new messages not being updated in some situations. --- src/Erebos/State.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Erebos/State.hs b/src/Erebos/State.hs index 3774d87..fefbffd 100644 --- a/src/Erebos/State.hs +++ b/src/Erebos/State.hs @@ -126,7 +126,10 @@ instance (HeadType a, MonadIO m) => MonadHead a (ReaderT (Head a) m) where updateLocalHead f = do h <- ask snd <$> updateHead' h (\h' -> local (const h') (f $ headStoredObject h')) - getLocalHeadCache _ = asks headCache + + getLocalHeadCache _ = do + h <- ask + snd <$> updateHead' h (\h' -> return ( headStoredObject h', headCache h' )) newtype LocalHeadT h m a = LocalHeadT { runLocalHeadT_ :: Storage -> ( Stored h, HeadCacheType h ) -> m ( a, ( Stored h, HeadCacheType h ) ) } -- cgit v1.2.3