diff --git a/apps/console/src/pages/organizations/cookie-banners/configuration/trackers/_components/TrackerPatternPropertiesSection.tsx b/apps/console/src/pages/organizations/cookie-banners/configuration/trackers/_components/TrackerPatternPropertiesSection.tsx index b95b3f7bf..e7ab4aada 100644 --- a/apps/console/src/pages/organizations/cookie-banners/configuration/trackers/_components/TrackerPatternPropertiesSection.tsx +++ b/apps/console/src/pages/organizations/cookie-banners/configuration/trackers/_components/TrackerPatternPropertiesSection.tsx @@ -118,8 +118,18 @@ export function TrackerPatternPropertiesSection({ type="button" className="p-1 rounded hover:bg-bg-hover transition-colors cursor-pointer" onClick={() => { - void navigator.clipboard.writeText(pattern.commonTrackerPatternId); - toast({ title: __("Copied"), description: __("Common Tracker ID copied to clipboard"), variant: "success" }); + const commonTrackerPatternId = pattern.commonTrackerPatternId; + if (!commonTrackerPatternId) { + return; + } + void (async () => { + try { + await navigator.clipboard.writeText(commonTrackerPatternId); + toast({ title: __("Copied"), description: __("Common Tracker ID copied to clipboard"), variant: "success" }); + } catch { + toast({ title: __("Error"), description: __("Failed to copy Common Tracker ID"), variant: "error" }); + } + })(); }} > diff --git a/pkg/proboctl/commontrackerpattern/show.go b/pkg/proboctl/commontrackerpattern/show.go index 44f4af97a..91f135910 100644 --- a/pkg/proboctl/commontrackerpattern/show.go +++ b/pkg/proboctl/commontrackerpattern/show.go @@ -70,7 +70,11 @@ func newCmdShow(f *cmdutil.Factory) *cobra.Command { if pattern.CommonThirdPartyID != nil { var party coredata.CommonThirdParty - if err := party.LoadByID(ctx, conn, *pattern.CommonThirdPartyID); err == nil { + if err := party.LoadByID(ctx, conn, *pattern.CommonThirdPartyID); err != nil { + if !errors.Is(err, coredata.ErrResourceNotFound) { + return fmt.Errorf("cannot load common third party: %w", err) + } + } else { thirdPartyName = party.Name } }