Skip to content

Commit 2f030b3

Browse files
authored
2470: Reduce Success Toast Message Appearence (#2482)
fix: increase success toast time and add contsant
1 parent 92e2b62 commit 2f030b3

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const C_E_AUTOSAVE_DEBOUNCE_MS = 3000; // ~3 seconds

alcs-frontend/src/app/features/compliance-and-enforcement/draft/draft.component.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { AfterViewInit, Component, OnDestroy, OnInit, ViewChild } from '@angular/core';
22
import { ActivatedRoute } from '@angular/router';
33
import { catchError, debounceTime, EMPTY, filter, firstValueFrom, skip, Subject, switchMap, takeUntil, tap } from 'rxjs';
4+
import { C_E_AUTOSAVE_DEBOUNCE_MS } from '../constants';
45
import {
56
ComplianceAndEnforcementDto,
67
InitialSubmissionType,
@@ -90,7 +91,7 @@ export class DraftComponent implements OnInit, AfterViewInit, OnDestroy {
9091
this.initialSubmissionType = overview.initialSubmissionType;
9192
}
9293
}),
93-
debounceTime(1000),
94+
debounceTime(C_E_AUTOSAVE_DEBOUNCE_MS),
9495
switchMap((overview) =>
9596
this.file?.uuid ? this.complianceAndEnforcementService.update(this.file.uuid, overview) : EMPTY,
9697
),
@@ -108,7 +109,7 @@ export class DraftComponent implements OnInit, AfterViewInit, OnDestroy {
108109
this.submitterComponent.$changes
109110
.pipe(
110111
skip(1), // Skip the initial emission to prevent save on load
111-
debounceTime(1000),
112+
debounceTime(C_E_AUTOSAVE_DEBOUNCE_MS),
112113
switchMap((submitter) =>
113114
this.submitter?.uuid
114115
? this.complianceAndEnforcementSubmitterService.update(this.submitter.uuid, submitter)
@@ -133,7 +134,7 @@ export class DraftComponent implements OnInit, AfterViewInit, OnDestroy {
133134
this.propertyComponent.$changes
134135
.pipe(
135136
skip(1), // Skip the initial emission to prevent save on load
136-
debounceTime(1000),
137+
debounceTime(C_E_AUTOSAVE_DEBOUNCE_MS),
137138
filter(() => this.propertyComponent?.form.dirty ?? false),
138139
switchMap((property) => {
139140
// Only auto-save if there are meaningful changes (non-empty fields)

0 commit comments

Comments
 (0)