From 0eb0380bea27b203647547d5fcd00b8d634c175f Mon Sep 17 00:00:00 2001 From: Vishal <64505169+vishalxl@users.noreply.github.com> Date: Mon, 21 Nov 2022 14:59:38 +0530 Subject: [PATCH] improved previous commit --- lib/tree_ds.dart | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/tree_ds.dart b/lib/tree_ds.dart index 6e446ac..1d4a8e7 100644 --- a/lib/tree_ds.dart +++ b/lib/tree_ds.dart @@ -877,10 +877,6 @@ class Store { // dont add this dummy in dummyEventIds list ( cause that's used to fetch events not in store) } else { tempChildEventsMap[parentId]?.children.add(tree); - - if( !gKindONames.containsKey(tree.event.eventData.pubkey)) { - gKindONames[tree.event.eventData.pubkey] = UserNameInfo(null, null, null, null, null ); - } } } else { // in case where the parent of the new event is not in the pool of all events, @@ -907,7 +903,12 @@ class Store { } }); // going over tempChildEventsMap and adding children to their parent's .children list - //log.info("in middle of fromJson"); + // for pubkeys that don't have any kind 0 events ( but have other evnets), add then to global kind0 store so they can still be accessed + tempChildEventsMap.forEach((key, value) { + if( !gKindONames.containsKey(value.event.eventData.pubkey)) { + gKindONames[value.event.eventData.pubkey] = UserNameInfo(null, null, null, null, null ); + } + }); tempChildEventsMap.forEach((newEventId, tree) { int eKind = tree.event.eventData.kind;