summaryrefslogtreecommitdiff
path: root/include/erebos
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2022-11-10 21:31:40 +0100
committerRoman Smrž <roman.smrz@seznam.cz>2022-11-10 21:31:40 +0100
commit7297ec818dae9c86b1f614743129553242cf23b6 (patch)
treed4cc15f2f0322196539997d499a0329340e13482 /include/erebos
parentdd136f7214cf68c9164fd32e76c48d2504a4e66a (diff)
Storage: reload head on watch start
Diffstat (limited to 'include/erebos')
-rw-r--r--include/erebos/storage.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/erebos/storage.h b/include/erebos/storage.h
index 735b399..62619a2 100644
--- a/include/erebos/storage.h
+++ b/include/erebos/storage.h
@@ -657,7 +657,8 @@ WatchedHead<T> Head<T>::watch(const std::function<void(const Head<T> &)> & watch
template<typename T>
Bhv<T> Head<T>::behavior() const
{
- return make_shared<HeadBhv<T>>(*this);
+ auto cur = ref().storage().template head<T>(id());
+ return make_shared<HeadBhv<T>>(cur ? *cur : *this);
}
template<class T>