From f26a552187ffe3005263f32b54ed060b56f6bdf0 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sat, 18 Jul 2026 09:42:51 +0200 Subject: [PATCH] Refactoring --- libs/ui/src/lib/value/value.component.ts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/libs/ui/src/lib/value/value.component.ts b/libs/ui/src/lib/value/value.component.ts index f7c06224f..494f7a347 100644 --- a/libs/ui/src/lib/value/value.component.ts +++ b/libs/ui/src/lib/value/value.component.ts @@ -183,12 +183,6 @@ export class GfValueComponent implements AfterViewInit, OnChanges, OnDestroy { } } - public ngOnDestroy() { - if (this.copyToClipboardTimeout) { - clearTimeout(this.copyToClipboardTimeout); - } - } - public onCopyValueToClipboard() { this.clipboard.copy(String(this.value)); @@ -213,12 +207,23 @@ export class GfValueComponent implements AfterViewInit, OnChanges, OnDestroy { ); } + public ngOnDestroy() { + if (this.copyToClipboardTimeout) { + clearTimeout(this.copyToClipboardTimeout); + } + } + private initializeVariables() { this.absoluteValue = 0; this.formattedValue = ''; + this.isCopied = false; this.isNumber = false; this.isString = false; this.locale = this.locale || getLocale(); this.useAbsoluteValue = false; + + if (this.copyToClipboardTimeout) { + clearTimeout(this.copyToClipboardTimeout); + } } }