diff options
| author | Roman Smrž <roman.smrz@seznam.cz> | 2026-10-11 11:15:07 +0200 |
|---|---|---|
| committer | Roman Smrž <roman.smrz@seznam.cz> | 2026-10-15 19:48:52 +0200 |
| commit | 0ff91d1803f10dd4c5caedb740d5f2022411a5d0 (patch) | |
| tree | 58a18a13c83a2613eb22d86ead4f09bad8d0c2ab | |
| parent | 1ec9f4ae125b72b430683cf4a9dcf0ff8fd176d8 (diff) | |
Fix getLocalHeadCache in ReaderT MonadHead instance
Changelog: Fixed status indicator for new messages not being updated in some situations.
| -rw-r--r-- | src/Erebos/State.hs | 5 |
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 ) ) } |