From bd41ce2b6bdb57f9daa88a9b0efb10d906bf4731 Mon Sep 17 00:00:00 2001 From: Ben Holmes Date: Tue, 5 May 2026 14:49:59 -0700 Subject: [PATCH] Update create-or-update-activity-dialog.component.ts fix: preserve existing symbol when cloning a manual asset activity When cloning an activity linked to a manual asset (VALUABLE, FEE, INTEREST, LIABILITY), the symbol field in onSubmit() was explicitly set to undefined for these types, causing the backend to generate a new UUID and create a duplicate SymbolProfile instead of reusing the existing one. Simplify the symbol assignment to always prefer searchSymbol.value.symbol (which correctly holds the existing asset's identifier when cloning) and fall back to name.value only when no symbol exists (i.e. when creating a brand-new manual asset). Fixes #5324 --- .../create-or-update-activity-dialog.component.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.component.ts b/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.component.ts index 1e943824c..39853c968 100644 --- a/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.component.ts +++ b/apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.component.ts @@ -500,11 +500,7 @@ export class GfCreateOrUpdateActivityDialogComponent { fee: this.activityForm.get('fee')?.value, quantity: this.activityForm.get('quantity')?.value, symbol: - (['FEE', 'INTEREST', 'LIABILITY', 'VALUABLE'].includes( - this.activityForm.get('type')?.value - ) - ? undefined - : this.activityForm.get('searchSymbol')?.value?.symbol) ?? + this.activityForm.get('searchSymbol')?.value?.symbol ?? this.activityForm.get('name')?.value, tags: this.activityForm.get('tags')?.value?.map(({ id }) => { return id;