diff --git a/CHANGELOG.md b/CHANGELOG.md index d520269e0f..42d7fb1710 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Deprecated the `api/v1/access` endpoints in favor of the `api/v1/accesses` endpoints +### Fixed + +- Fixed the double submission of forms in the account detail dialog, the create or update access dialog, the historical market data editor, the import activities dialog, the coupon system and the create asset profile dialog of the admin control panel + ## 3.93.0 - 2026-10-25 ### Changed diff --git a/apps/client/src/app/components/account-detail-dialog/account-detail-dialog.component.ts b/apps/client/src/app/components/account-detail-dialog/account-detail-dialog.component.ts index bc5818062d..ce31645986 100644 --- a/apps/client/src/app/components/account-detail-dialog/account-detail-dialog.component.ts +++ b/apps/client/src/app/components/account-detail-dialog/account-detail-dialog.component.ts @@ -34,7 +34,8 @@ import { Component, DestroyRef, inject, - OnInit + OnInit, + signal } from '@angular/core'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { MatButtonModule } from '@angular/material/button'; @@ -57,7 +58,7 @@ import { } from 'ionicons/icons'; import { isNumber } from 'lodash-es'; import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; -import { filter, forkJoin } from 'rxjs'; +import { filter, finalize, forkJoin } from 'rxjs'; import { AccountDetailDialogParams, @@ -104,6 +105,7 @@ export class GfAccountDetailDialogComponent implements OnInit { protected interestInBaseCurrencyPrecision = 2; protected isLoading = true; protected isLoadingChart: boolean; + protected readonly isSubmitting = signal(false); protected name: string | null; protected netPerformancePercentageWithCurrencyEffect: number; protected netPerformancePercentageWithCurrencyEffectPrecision = 2; @@ -171,9 +173,16 @@ export class GfAccountDetailDialogComponent implements OnInit { } protected onAddAccountBalance(accountBalance: CreateAccountBalanceDto) { + this.isSubmitting.set(true); + this.dataService .postAccountBalance(accountBalance) - .pipe(takeUntilDestroyed(this.destroyRef)) + .pipe( + finalize(() => { + this.isSubmitting.set(false); + }), + takeUntilDestroyed(this.destroyRef) + ) .subscribe(() => { this.initialize(); diff --git a/apps/client/src/app/components/account-detail-dialog/account-detail-dialog.html b/apps/client/src/app/components/account-detail-dialog/account-detail-dialog.html index 7d35884705..c5f82d294a 100644 --- a/apps/client/src/app/components/account-detail-dialog/account-detail-dialog.html +++ b/apps/client/src/app/components/account-detail-dialog/account-detail-dialog.html @@ -213,6 +213,7 @@ [accountCurrency]="currency" [accountId]="data.accountId" [currentBalance]="balance" + [isSubmitting]="isSubmitting()" [locale]="user?.settings?.locale" [showActions]=" hasPermissionToDeleteAccountBalance && diff --git a/apps/client/src/app/components/admin-market-data/create-asset-profile-dialog/create-asset-profile-dialog.component.ts b/apps/client/src/app/components/admin-market-data/create-asset-profile-dialog/create-asset-profile-dialog.component.ts index 8b7ef793fc..e2a830b8ee 100644 --- a/apps/client/src/app/components/admin-market-data/create-asset-profile-dialog/create-asset-profile-dialog.component.ts +++ b/apps/client/src/app/components/admin-market-data/create-asset-profile-dialog/create-asset-profile-dialog.component.ts @@ -14,7 +14,8 @@ import { Component, DestroyRef, inject, - OnInit + OnInit, + signal } from '@angular/core'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { @@ -33,7 +34,7 @@ import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; import { MatRadioModule } from '@angular/material/radio'; import { isISO4217CurrencyCode } from 'class-validator'; -import { switchMap } from 'rxjs'; +import { finalize, switchMap } from 'rxjs'; import type { CreateAssetProfileDialogMode, @@ -60,6 +61,7 @@ import type { export class GfCreateAssetProfileDialogComponent implements OnInit { protected createAssetProfileForm: CreateAssetProfileForm; protected readonly ghostfolioPrefix = `${ghostfolioPrefix}_`; + protected readonly isSubmitting = signal(false); protected mode: CreateAssetProfileDialogMode; private customCurrencies: string[]; @@ -130,6 +132,8 @@ export class GfCreateAssetProfileDialogComponent implements OnInit { new Set([...this.customCurrencies, currency]) ).sort(); + this.isSubmitting.set(true); + this.dataService .putAdminSetting(PROPERTY_CURRENCIES, { value: JSON.stringify(currencies) @@ -141,6 +145,9 @@ export class GfCreateAssetProfileDialogComponent implements OnInit { symbol: `${DEFAULT_CURRENCY}${currency}` }); }), + finalize(() => { + this.isSubmitting.set(false); + }), takeUntilDestroyed(this.destroyRef) ) .subscribe(() => { diff --git a/apps/client/src/app/components/admin-market-data/create-asset-profile-dialog/create-asset-profile-dialog.html b/apps/client/src/app/components/admin-market-data/create-asset-profile-dialog/create-asset-profile-dialog.html index 06fa59df07..80a1ff9dd5 100644 --- a/apps/client/src/app/components/admin-market-data/create-asset-profile-dialog/create-asset-profile-dialog.html +++ b/apps/client/src/app/components/admin-market-data/create-asset-profile-dialog/create-asset-profile-dialog.html @@ -1,7 +1,7 @@