diff options
author | Chocobozzz <me@florianbigard.com> | 2020-11-16 16:46:15 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-11-16 16:46:15 +0100 |
commit | 12c8a46362f1f92d1c1a34991a76c55f625a80c6 (patch) | |
tree | 7bd51d84845359d6ce821033b8898687a6ff757f /client/src/app/+about/about-instance/about-instance.resolver.ts | |
parent | a75eb7489c92869a7ca46d0c484fccdecc3ed7a2 (diff) | |
download | PeerTube-12c8a46362f1f92d1c1a34991a76c55f625a80c6.tar.gz PeerTube-12c8a46362f1f92d1c1a34991a76c55f625a80c6.tar.zst PeerTube-12c8a46362f1f92d1c1a34991a76c55f625a80c6.zip |
Fix about scrolling behaviour
Diffstat (limited to 'client/src/app/+about/about-instance/about-instance.resolver.ts')
-rw-r--r-- | client/src/app/+about/about-instance/about-instance.resolver.ts | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/client/src/app/+about/about-instance/about-instance.resolver.ts b/client/src/app/+about/about-instance/about-instance.resolver.ts index b2349ba12..9a5924ebb 100644 --- a/client/src/app/+about/about-instance/about-instance.resolver.ts +++ b/client/src/app/+about/about-instance/about-instance.resolver.ts | |||
@@ -2,15 +2,19 @@ import { forkJoin } from 'rxjs' | |||
2 | import { map, switchMap } from 'rxjs/operators' | 2 | import { map, switchMap } from 'rxjs/operators' |
3 | import { Injectable } from '@angular/core' | 3 | import { Injectable } from '@angular/core' |
4 | import { ActivatedRouteSnapshot, Resolve } from '@angular/router' | 4 | import { ActivatedRouteSnapshot, Resolve } from '@angular/router' |
5 | import { ServerService } from '@app/core' | ||
5 | import { InstanceService } from '@app/shared/shared-instance' | 6 | import { InstanceService } from '@app/shared/shared-instance' |
6 | import { About } from '@shared/models/server' | 7 | import { About, ServerConfig } from '@shared/models/server' |
7 | 8 | ||
8 | export type ResolverData = { about: About, languages: string[], categories: string[] } | 9 | export type ResolverData = { about: About, languages: string[], categories: string[], serverConfig: ServerConfig } |
9 | 10 | ||
10 | @Injectable() | 11 | @Injectable() |
11 | export class AboutInstanceResolver implements Resolve<any> { | 12 | export class AboutInstanceResolver implements Resolve<any> { |
12 | 13 | ||
13 | constructor (private instanceService: InstanceService) {} | 14 | constructor ( |
15 | private instanceService: InstanceService, | ||
16 | private serverService: ServerService | ||
17 | ) {} | ||
14 | 18 | ||
15 | resolve (route: ActivatedRouteSnapshot) { | 19 | resolve (route: ActivatedRouteSnapshot) { |
16 | return this.instanceService.getAbout() | 20 | return this.instanceService.getAbout() |
@@ -18,8 +22,9 @@ export class AboutInstanceResolver implements Resolve<any> { | |||
18 | switchMap(about => { | 22 | switchMap(about => { |
19 | return forkJoin([ | 23 | return forkJoin([ |
20 | this.instanceService.buildTranslatedLanguages(about), | 24 | this.instanceService.buildTranslatedLanguages(about), |
21 | this.instanceService.buildTranslatedCategories(about) | 25 | this.instanceService.buildTranslatedCategories(about), |
22 | ]).pipe(map(([ languages, categories ]) => ({ about, languages, categories }))) | 26 | this.serverService.getConfig() |
27 | ]).pipe(map(([ languages, categories, serverConfig ]) => ({ about, languages, categories, serverConfig }))) | ||
23 | }) | 28 | }) |
24 | ) | 29 | ) |
25 | } | 30 | } |