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',
private redirectService: RedirectService,
private screenService: ScreenService,
private hotkeysService: HotkeysService,
- private themeService: ThemeService
+ private themeService: ThemeService,
+ private hooks: HooksService
) { }
get serverVersion () {
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())
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 () {
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