Et2LinkList: Fix file uploads when entry is not yet saved doubled the list of links

This commit is contained in:
nathan 2024-11-05 14:51:08 -07:00
parent 86c014fb94
commit 25ff5fe490

View File

@ -284,7 +284,10 @@ export class Et2LinkList extends Et2LinkString
// Add in new links from LinkTo // Add in new links from LinkTo
for(let link of <LinkInfo[]>Object.values(_ev.detail || [])) for(let link of <LinkInfo[]>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); this._link_list.unshift(link);
} }