From 4334445d043252661e62cf97f76b67a2c43e3750 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 22 Aug 2019 16:13:26 +0200 Subject: Dismiss modals on pop state --- client/src/app/app.component.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts index 50c5f5b9b..065bdcaa4 100644 --- a/client/src/app/app.component.ts +++ b/client/src/app/app.component.ts @@ -8,9 +8,10 @@ import { debounceTime, filter, map, pairwise, skip } from 'rxjs/operators' import { Hotkey, HotkeysService } from 'angular2-hotkeys' import { I18n } from '@ngx-translate/i18n-polyfill' import { fromEvent } from 'rxjs' -import { ViewportScroller } from '@angular/common' +import { PlatformLocation, ViewportScroller } from '@angular/common' import { PluginService } from '@app/core/plugins/plugin.service' import { HooksService } from '@app/core/plugins/hooks.service' +import { NgbModal } from '@ng-bootstrap/ng-bootstrap' @Component({ selector: 'my-app', @@ -35,7 +36,9 @@ export class AppComponent implements OnInit { private screenService: ScreenService, private hotkeysService: HotkeysService, private themeService: ThemeService, - private hooks: HooksService + private hooks: HooksService, + private location: PlatformLocation, + private modalService: NgbModal ) { } get serverVersion () { @@ -90,6 +93,8 @@ export class AppComponent implements OnInit { fromEvent(window, 'resize') .pipe(debounceTime(200)) .subscribe(() => this.onResize()) + + this.location.onPopState(() => this.modalService.dismissAll()) } isUserLoggedIn () { -- cgit v1.2.3