From 25ff5fe490db41b62122cbb3f9325866b019f1ff Mon Sep 17 00:00:00 2001 From: nathan Date: Tue, 5 Nov 2024 14:51:08 -0700 Subject: [PATCH] Et2LinkList: Fix file uploads when entry is not yet saved doubled the list of links --- api/js/etemplate/Et2Link/Et2LinkList.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/js/etemplate/Et2Link/Et2LinkList.ts b/api/js/etemplate/Et2Link/Et2LinkList.ts index b009a73357..e309a6b3e9 100644 --- a/api/js/etemplate/Et2Link/Et2LinkList.ts +++ b/api/js/etemplate/Et2Link/Et2LinkList.ts @@ -284,7 +284,10 @@ export class Et2LinkList extends Et2LinkString // Add in new links from LinkTo for(let link of Object.values(_ev.detail || [])) { - if(!this._link_list.some(l => l.app == link.app && l.id == link.id)) + if(!this._link_list.some(l => l.app == link.app && (l.id == link.id || + // Unsaved + typeof link.id == "object" && typeof l.id == "object" && link.id.id == l.id.id + ))) { this._link_list.unshift(link); }