aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/app.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-08-22 17:16:48 +0200
committerChocobozzz <me@florianbigard.com>2019-08-22 17:16:48 +0200
commit001ed2d40c8d2c8f494f5dc7f91ed62d56df10fd (patch)
tree9a88235affe49fce4b7ce2df192931cffaec32e9 /client/src/app/app.component.ts
parentd5c8932a601c1854db0a2e399ccaf26e17385f1a (diff)
parent60c2bc80b82c71bd63bdb1fcf64d4d49491ce5c8 (diff)
downloadPeerTube-001ed2d40c8d2c8f494f5dc7f91ed62d56df10fd.tar.gz
PeerTube-001ed2d40c8d2c8f494f5dc7f91ed62d56df10fd.tar.zst
PeerTube-001ed2d40c8d2c8f494f5dc7f91ed62d56df10fd.zip
Merge branch 'release/1.4.0' into develop
Diffstat (limited to 'client/src/app/app.component.ts')
-rw-r--r--client/src/app/app.component.ts13
1 files changed, 10 insertions, 3 deletions
diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts
index 50c5f5b9b..64bfb9671 100644
--- a/client/src/app/app.component.ts
+++ b/client/src/app/app.component.ts
@@ -8,9 +8,11 @@ import { debounceTime, filter, map, pairwise, skip } from 'rxjs/operators'
8import { Hotkey, HotkeysService } from 'angular2-hotkeys' 8import { Hotkey, HotkeysService } from 'angular2-hotkeys'
9import { I18n } from '@ngx-translate/i18n-polyfill' 9import { I18n } from '@ngx-translate/i18n-polyfill'
10import { fromEvent } from 'rxjs' 10import { fromEvent } from 'rxjs'
11import { ViewportScroller } from '@angular/common' 11import { PlatformLocation, ViewportScroller } from '@angular/common'
12import { PluginService } from '@app/core/plugins/plugin.service' 12import { PluginService } from '@app/core/plugins/plugin.service'
13import { HooksService } from '@app/core/plugins/hooks.service' 13import { HooksService } from '@app/core/plugins/hooks.service'
14import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
15import { POP_STATE_MODAL_DISMISS } from '@app/shared/misc/constants'
14 16
15@Component({ 17@Component({
16 selector: 'my-app', 18 selector: 'my-app',
@@ -35,7 +37,9 @@ export class AppComponent implements OnInit {
35 private screenService: ScreenService, 37 private screenService: ScreenService,
36 private hotkeysService: HotkeysService, 38 private hotkeysService: HotkeysService,
37 private themeService: ThemeService, 39 private themeService: ThemeService,
38 private hooks: HooksService 40 private hooks: HooksService,
41 private location: PlatformLocation,
42 private modalService: NgbModal
39 ) { } 43 ) { }
40 44
41 get serverVersion () { 45 get serverVersion () {
@@ -90,6 +94,8 @@ export class AppComponent implements OnInit {
90 fromEvent(window, 'resize') 94 fromEvent(window, 'resize')
91 .pipe(debounceTime(200)) 95 .pipe(debounceTime(200))
92 .subscribe(() => this.onResize()) 96 .subscribe(() => this.onResize())
97
98 this.location.onPopState(() => this.modalService.dismissAll(POP_STATE_MODAL_DISMISS))
93 } 99 }
94 100
95 isUserLoggedIn () { 101 isUserLoggedIn () {
@@ -110,7 +116,6 @@ export class AppComponent implements OnInit {
110 const eventsObs = this.router.events 116 const eventsObs = this.router.events
111 117
112 const scrollEvent = eventsObs.pipe(filter((e: Event): e is Scroll => e instanceof Scroll)) 118 const scrollEvent = eventsObs.pipe(filter((e: Event): e is Scroll => e instanceof Scroll))
113 const navigationEndEvent = eventsObs.pipe(filter((e: Event): e is NavigationEnd => e instanceof NavigationEnd))
114 119
115 scrollEvent.subscribe(e => { 120 scrollEvent.subscribe(e => {
116 if (e.position) { 121 if (e.position) {
@@ -126,6 +131,8 @@ export class AppComponent implements OnInit {
126 } 131 }
127 }) 132 })
128 133
134 const navigationEndEvent = eventsObs.pipe(filter((e: Event): e is NavigationEnd => e instanceof NavigationEnd))
135
129 // When we add the a-state parameter, we don't want to alter the scroll 136 // When we add the a-state parameter, we don't want to alter the scroll
130 navigationEndEvent.pipe(pairwise()) 137 navigationEndEvent.pipe(pairwise())
131 .subscribe(([ e1, e2 ]) => { 138 .subscribe(([ e1, e2 ]) => {