summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2026-10-11 11:15:07 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2026-10-15 19:48:52 +0200
commit0ff91d1803f10dd4c5caedb740d5f2022411a5d0 (patch)
tree58a18a13c83a2613eb22d86ead4f09bad8d0c2ab /src
parent1ec9f4ae125b72b430683cf4a9dcf0ff8fd176d8 (diff)
Fix getLocalHeadCache in ReaderT MonadHead instance
Changelog: Fixed status indicator for new messages not being updated in some situations.
Diffstat (limited to 'src')
-rw-r--r--src/Erebos/State.hs5
1 files changed, 4 insertions, 1 deletions
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 ) ) }