Logging & Styling

This commit is contained in:
Bastian Wagner
2026-02-16 12:11:30 +01:00
parent 2eafa21baf
commit 9ea2229f5a
29 changed files with 169 additions and 90 deletions

View File

@@ -44,6 +44,9 @@ export class SettingsComponent {
}
closeSidebar() {
if (this.isDirty()) {
this.toast.warning('Ungespeicherte Änderungen wurden verworfen.');
}
this.isOpen = false;
}
@@ -83,11 +86,13 @@ export class SettingsComponent {
next: () => {
this.toast.success('Gespeichert')
this.isLoading = false;
this.userSettings.markAsPristine();
}
});
}
saveUser() {
this.isDirty();
const user = this.authService.user;
user.firstName = this.$userData.firstName.value!;
user.lastName = this.$userData.lastName.value!;
@@ -95,8 +100,14 @@ export class SettingsComponent {
this.api.saveUser(user).subscribe({
next: () => {
this.toast.success('Gespeichert')
this.toast.success('Gespeichert');
this.userSettings.markAsPristine()
}
})
}
isDirty(): boolean {
return this.userData.dirty || this.userSettings.dirty;
}
}