Logging & Styling
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user