X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2F%2Bvideos%2F%2Bvideo-edit%2Fvideo-add.component.ts;h=8606b82222c4c4e95009dc867d7ac2919b8311af;hb=8cbc40b2fe9d36ef0505b9441276ca561342e9e9;hp=441d5a3db839f8e9d4fabd9decc6f121d13db58a;hpb=c6c0fa6cd8fe8f752463d8982c3dbcd448739c4e;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/+videos/+video-edit/video-add.component.ts b/client/src/app/+videos/+video-edit/video-add.component.ts index 441d5a3db..8606b8222 100644 --- a/client/src/app/+videos/+video-edit/video-add.component.ts +++ b/client/src/app/+videos/+video-edit/video-add.component.ts @@ -1,6 +1,7 @@ import { Component, HostListener, OnInit, ViewChild } from '@angular/core' +import { ActivatedRoute, Router } from '@angular/router' import { AuthService, AuthUser, CanComponentDeactivate, ServerService } from '@app/core' -import { ServerConfig } from '@shared/models' +import { HTMLServerConfig } from '@shared/models' import { VideoEditType } from './shared/video-edit.type' import { VideoGoLiveComponent } from './video-add-components/video-go-live.component' import { VideoImportTorrentComponent } from './video-add-components/video-import-torrent.component' @@ -22,11 +23,16 @@ export class VideoAddComponent implements OnInit, CanComponentDeactivate { secondStepType: VideoEditType videoName: string - serverConfig: ServerConfig + + activeNav: string + + private serverConfig: HTMLServerConfig constructor ( private auth: AuthService, - private serverService: ServerService + private serverService: ServerService, + private route: ActivatedRoute, + private router: Router ) {} get userInformationLoaded () { @@ -36,12 +42,19 @@ export class VideoAddComponent implements OnInit, CanComponentDeactivate { ngOnInit () { this.user = this.auth.getUser() - this.serverConfig = this.serverService.getTmpConfig() - - this.serverService.getConfig() - .subscribe(config => this.serverConfig = config) + this.serverConfig = this.serverService.getHTMLConfig() this.user = this.auth.getUser() + + if (this.route.snapshot.fragment) { + this.onNavChange(this.route.snapshot.fragment) + } + } + + onNavChange (newActiveNav: string) { + this.activeNav = newActiveNav + + this.router.navigate([], { fragment: this.activeNav }) } onFirstStepDone (type: VideoEditType, videoName: string) {