diff --git a/DigitalData.UserManager.API/ClientApp/user_manager_ui/src/app/components/nav-menu/nav-menu.component.html b/DigitalData.UserManager.API/ClientApp/user_manager_ui/src/app/components/nav-menu/nav-menu.component.html
index d887bd2..0e0a0bd 100644
--- a/DigitalData.UserManager.API/ClientApp/user_manager_ui/src/app/components/nav-menu/nav-menu.component.html
+++ b/DigitalData.UserManager.API/ClientApp/user_manager_ui/src/app/components/nav-menu/nav-menu.component.html
@@ -30,6 +30,9 @@
User Manager Portal
+
diff --git a/DigitalData.UserManager.API/ClientApp/user_manager_ui/src/app/components/nav-menu/nav-menu.component.ts b/DigitalData.UserManager.API/ClientApp/user_manager_ui/src/app/components/nav-menu/nav-menu.component.ts
index 2ef86df..40ef122 100644
--- a/DigitalData.UserManager.API/ClientApp/user_manager_ui/src/app/components/nav-menu/nav-menu.component.ts
+++ b/DigitalData.UserManager.API/ClientApp/user_manager_ui/src/app/components/nav-menu/nav-menu.component.ts
@@ -8,6 +8,7 @@ import { ColorModeBttnComponent } from '../common/color-mode-bttn/color-mode-btt
import { MatIconModule } from '@angular/material/icon';
import { RefreshService } from '../../services/refresh.service';
import { CreationService } from '../../services/creation.service';
+import { UpdateService } from '../../services/update.service';
@Component({
standalone: true,
@@ -22,7 +23,7 @@ export class NavMenuComponent {
}
isExpanded = false;
- constructor(private dialog: MatDialog, private authService: AuthenticationService, public refreshService: RefreshService, public creationService : CreationService) {
+ constructor(private dialog: MatDialog, private authService: AuthenticationService, public refreshService: RefreshService, public creationService : CreationService, public updateService: UpdateService) {
this.authService.isAuthenticated().then().catch()
}
diff --git a/DigitalData.UserManager.API/ClientApp/user_manager_ui/src/app/services/update.service.spec.ts b/DigitalData.UserManager.API/ClientApp/user_manager_ui/src/app/services/update.service.spec.ts
new file mode 100644
index 0000000..b51fcc8
--- /dev/null
+++ b/DigitalData.UserManager.API/ClientApp/user_manager_ui/src/app/services/update.service.spec.ts
@@ -0,0 +1,16 @@
+import { TestBed } from '@angular/core/testing';
+
+import { UpdateService } from './update.service';
+
+describe('UpdateService', () => {
+ let service: UpdateService;
+
+ beforeEach(() => {
+ TestBed.configureTestingModule({});
+ service = TestBed.inject(UpdateService);
+ });
+
+ it('should be created', () => {
+ expect(service).toBeTruthy();
+ });
+});
diff --git a/DigitalData.UserManager.API/ClientApp/user_manager_ui/src/app/services/update.service.ts b/DigitalData.UserManager.API/ClientApp/user_manager_ui/src/app/services/update.service.ts
new file mode 100644
index 0000000..d69fc59
--- /dev/null
+++ b/DigitalData.UserManager.API/ClientApp/user_manager_ui/src/app/services/update.service.ts
@@ -0,0 +1,30 @@
+import { Injectable } from '@angular/core';
+
+@Injectable({
+ providedIn: 'root'
+})
+export class UpdateService {
+
+ constructor() { }
+
+ private async_actions: Array<() => Promise
> = [];
+ private actions: Array<() => void> = [];
+
+ addAsync(action: () => Promise): void {
+ this.async_actions.push(action);
+ }
+
+ add(action: () => void): void {
+ this.actions.push(action);
+ }
+
+ removeAll(): void {
+ this.async_actions = [];
+ }
+
+ async executeAll(): Promise {
+ await Promise.all(this.async_actions.map(action => action()));
+ this.actions.forEach(action => action());
+ this.removeAll();
+ }
+}
\ No newline at end of file