X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fapp.component.ts;h=83a751dd6003f7ef59b7c8ec080b94393456277d;hb=6e44fb37634ce1280b5ff03e2d367f2eaa334272;hp=0ebd628fce46b1f5da440a7276cefa813323f820;hpb=ffb321bedca46d6987c7b31dd58e5dea96ea2ea2;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts index 0ebd628fc..83a751dd6 100644 --- a/client/src/app/app.component.ts +++ b/client/src/app/app.component.ts @@ -10,6 +10,7 @@ import { I18n } from '@ngx-translate/i18n-polyfill' import { fromEvent } from 'rxjs' import { ViewportScroller } from '@angular/common' import { PluginService } from '@app/core/plugins/plugin.service' +import { HooksService } from '@app/core/plugins/hooks.service' @Component({ selector: 'my-app', @@ -33,7 +34,8 @@ export class AppComponent implements OnInit { private redirectService: RedirectService, private screenService: ScreenService, private hotkeysService: HotkeysService, - private themeService: ThemeService + private themeService: ThemeService, + private hooks: HooksService ) { } get serverVersion () { @@ -160,6 +162,10 @@ export class AppComponent implements OnInit { filter(pathname => !pathname || pathname === '/' || is18nPath(pathname)) ).subscribe(() => this.redirectService.redirectToHomepage(true)) + navigationEndEvent.subscribe(e => { + this.hooks.runAction('action:router.navigation-end', 'common', { path: e.url }) + }) + eventsObs.pipe( filter((e: Event): e is GuardsCheckStart => e instanceof GuardsCheckStart), filter(() => this.screenService.isInSmallView()) @@ -204,9 +210,7 @@ export class AppComponent implements OnInit { private async loadPlugins () { this.pluginService.initializePlugins() - await this.pluginService.loadPluginsByScope('common') - - this.pluginService.runHook('action:application.loaded') + this.hooks.runAction('action:application.init', 'common') } private initHotkeys () { @@ -222,7 +226,7 @@ export class AppComponent implements OnInit { new Hotkey('g o', (event: KeyboardEvent): boolean => { this.router.navigate([ '/videos/overview' ]) return false - }, undefined, this.i18n('Go to the videos overview page')), + }, undefined, this.i18n('Go to the videos discover page')), new Hotkey('g t', (event: KeyboardEvent): boolean => { this.router.navigate([ '/videos/trending' ]) return false