From 6e4394d59ec31fe03e62bb5cf76f558b60a3943d Mon Sep 17 00:00:00 2001 From: sixlighthouses Date: Mon, 7 Aug 2023 09:47:58 +1000 Subject: [PATCH] use set to de dupe the workbench items in the set method --- lib/Models/Workbench.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/Models/Workbench.ts b/lib/Models/Workbench.ts index c508fee8639..be39533aafe 100644 --- a/lib/Models/Workbench.ts +++ b/lib/Models/Workbench.ts @@ -34,7 +34,12 @@ export default class Workbench { return this._items.map(dereferenceModel); } set items(items: readonly BaseModel[]) { - this._items.spliceWithArray(0, this._items.length, items.slice()); + const setItems = new Set(items); + this._items.spliceWithArray( + 0, + this._items.length, + Array.from(setItems).slice() + ); } /**