diff --git a/src/app/layouts/default-layout/default-layout.component.html b/src/app/layouts/default-layout/default-layout.component.html index 6db74f4b..cc1c7030 100644 --- a/src/app/layouts/default-layout/default-layout.component.html +++ b/src/app/layouts/default-layout/default-layout.component.html @@ -4,7 +4,7 @@ - + diff --git a/src/app/layouts/default-layout/default-layout.component.ts b/src/app/layouts/default-layout/default-layout.component.ts index 87556ddc..9c178f7e 100644 --- a/src/app/layouts/default-layout/default-layout.component.ts +++ b/src/app/layouts/default-layout/default-layout.component.ts @@ -6,6 +6,7 @@ import { Subscription } from 'rxjs'; import { ToasterService } from '../../services/toaster.service'; import { ProgressService } from '../../common/progress/progress.service'; import { version } from './../../version'; +import { Router } from '@angular/router'; @Component({ @@ -29,7 +30,8 @@ export class DefaultLayoutComponent implements OnInit, OnDestroy { private recentlyOpenedProjectService: RecentlyOpenedProjectService, private serverManagement: ServerManagementService, private toasterService: ToasterService, - private progressService: ProgressService + private progressService: ProgressService, + private router: Router ) {} ngOnInit() { @@ -54,6 +56,11 @@ export class DefaultLayoutComponent implements OnInit, OnDestroy { this.shouldStopServersOnClosing = this.electronService.isElectronApp; } + backToProject() { + this.router.navigate(['/server', this.recentlyOpenedServerId, 'project', this.recentlyOpenedProjectId]) + .catch(error => this.toasterService.error('Cannot navigate to the last opened project')); + } + @HostListener('window:beforeunload', ['$event']) async onBeforeUnload($event) { if(!this.shouldStopServersOnClosing) {