Skip to content

Commit

Permalink
#175 make users aware of unsaved changes when creating a new story
Browse files Browse the repository at this point in the history
  • Loading branch information
a-kikhia committed Jan 6, 2025
1 parent d41fb34 commit 05ca02c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/app/workbench/presentation/header/header/header.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,15 @@ export class HeaderComponent {
}

createNewDomainStory(): void {
this.titleService.reset();
this.renderService.reset();
if (this.dirtyFlagService.dirty) {
this.importService.openUnsavedChangesReminderDialog(() => {
this.titleService.reset();
this.renderService.reset();
});
} else {
this.titleService.reset();
this.renderService.reset();
}
}

onImport(): void {
Expand Down

0 comments on commit 05ca02c

Please sign in to comment.