From 8b180ffd0551831931cdb61c925987f9014adad8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Wed, 27 Apr 2022 22:45:00 +0200 Subject: Local identity with shared state updates --- src/state.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/state.cpp') diff --git a/src/state.cpp b/src/state.cpp index 82fe907..6ad9f89 100644 --- a/src/state.cpp +++ b/src/state.cpp @@ -25,6 +25,14 @@ LocalState::LocalState(const Ref & ref): for (auto i : rec->items("shared")) if (const auto & x = i.as()) p->shared.tip.push_back(*x); + + if (p->identity) { + vector>> updates; + for (const auto & r : lookupShared(SharedType>::id)) + updates.push_back(Stored>::load(r)); + if (!updates.empty()) + p->identity = p->identity->update(updates); + } } Ref LocalState::store(const Storage & st) const -- cgit v1.2.3