From 68e1cd008ed7e59b50f4c21884df3263c2922717 Mon Sep 17 00:00:00 2001 From: alyssaf16 Date: Fri, 23 Feb 2024 22:46:57 -0500 Subject: change --- src/client/views/nodes/DocumentView.tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index e8b0fc4ba..ed5d31664 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -627,7 +627,7 @@ export class DocumentViewInternal extends DocComponent !Doc.AreProtosEqual(collection, tagDoc)) - .reduce((aset, tagDoc) => { - if (Array.from(aset).find(doc => Doc.AreProtosEqual(tagDoc, doc))) return aset; + .map(tagDoc => { let embedding = collectionDocs.find(doc => Doc.AreProtosEqual(tagDoc, doc)); if (!embedding) { embedding = Doc.MakeEmbedding(tagDoc); @@ -1511,10 +1510,9 @@ ScriptingGlobals.add(function updateTagsCollection(collection: Doc) { wid += NumCast(tagDoc._width); created = true; } - aset.add(embedding); - return aset; - }, new Set()); + return embedding; + }); - created && (collection[DocData].data = new List(Array.from(matchedDocs))); + created && (collection[DocData].data = new List(matchedDocs)); return true; }); -- cgit v1.2.3-70-g09d2