feat(project-editor): warn before leaving with unsaved changes

This commit is contained in:
sdarbinyan
2026-07-13 15:21:39 +04:00
parent 1e7add2fc8
commit 26c07fb3e6
3 changed files with 24 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
import { Routes } from '@angular/router';
import { languageGuard } from './guards/language.guard';
import { projectEditorDirtyGuard } from './features/project-editor/guards/project-editor-dirty.guard';
import { environment } from '../environments/environment';
// Core routes (same across all brands)
@@ -41,7 +42,8 @@ const coreRoutes: Routes = [
},
{
path: 'edit/:section',
loadComponent: () => import('./features/project-editor/pages/project-editor-page.component').then(m => m.ProjectEditorPageComponent)
loadComponent: () => import('./features/project-editor/pages/project-editor-page.component').then(m => m.ProjectEditorPageComponent),
canDeactivate: [projectEditorDirtyGuard]
},
{
path: 'edit',