aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/DocumentView.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2024-02-22 09:33:38 -0500
committerbobzel <zzzman@gmail.com>2024-02-22 09:33:38 -0500
commitcf85ee4ea73985529a16321d671d893ddb862439 (patch)
tree00310b2593a3b350648e1a482ae02f98263690eb /src/client/views/nodes/DocumentView.tsx
parent158b589c2a5c9d2deb537e827ca31f93335957ea (diff)
fixed search to update after typing delay. fixed collection of tags to set container for embeddings
Diffstat (limited to 'src/client/views/nodes/DocumentView.tsx')
-rw-r--r--src/client/views/nodes/DocumentView.tsx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx
index e8b0fc4ba..d131f72d5 100644
--- a/src/client/views/nodes/DocumentView.tsx
+++ b/src/client/views/nodes/DocumentView.tsx
@@ -1501,8 +1501,7 @@ ScriptingGlobals.add(function updateTagsCollection(collection: Doc) {
const matchedDocs = matchedTags
.filter(tagDoc => !Doc.AreProtosEqual(collection, tagDoc))
.reduce((aset, tagDoc) => {
- if (Array.from(aset).find(doc => Doc.AreProtosEqual(tagDoc, doc))) return aset;
- let embedding = collectionDocs.find(doc => Doc.AreProtosEqual(tagDoc, doc));
+ let embedding = Array.from(aset).find(doc => Doc.AreProtosEqual(tagDoc, doc)) ?? collectionDocs.find(doc => Doc.AreProtosEqual(tagDoc, doc));
if (!embedding) {
embedding = Doc.MakeEmbedding(tagDoc);
embedding.x = wid;
@@ -1511,6 +1510,7 @@ ScriptingGlobals.add(function updateTagsCollection(collection: Doc) {
wid += NumCast(tagDoc._width);
created = true;
}
+ Doc.SetContainer(embedding, collection);
aset.add(embedding);
return aset;
}, new Set<Doc>());