From 21e6dc811d18637dbadb31c724420361913dbc29 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 21 Jan 2020 10:52:22 +0100 Subject: Cleanup login form --- client/src/app/header/header.component.ts | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) (limited to 'client/src/app/header/header.component.ts') diff --git a/client/src/app/header/header.component.ts b/client/src/app/header/header.component.ts index 5fd122930..92a7eded6 100644 --- a/client/src/app/header/header.component.ts +++ b/client/src/app/header/header.component.ts @@ -2,9 +2,8 @@ import { filter, first, map, tap } from 'rxjs/operators' import { Component, OnInit } from '@angular/core' import { ActivatedRoute, NavigationEnd, Params, Router } from '@angular/router' import { getParameterByName } from '../shared/misc/utils' -import { AuthService, ServerService, Notifier } from '@app/core' +import { AuthService, Notifier, ServerService } from '@app/core' import { of } from 'rxjs' -import { ServerConfig } from '@shared/models' import { I18n } from '@ngx-translate/i18n-polyfill' @Component({ @@ -17,8 +16,6 @@ export class HeaderComponent implements OnInit { searchValue = '' ariaLabelTextForSearch = '' - private serverConfig: ServerConfig - constructor ( private router: Router, private route: ActivatedRoute, @@ -38,23 +35,6 @@ export class HeaderComponent implements OnInit { map(() => getParameterByName('search', window.location.href)) ) .subscribe(searchQuery => this.searchValue = searchQuery || '') - - this.serverConfig = this.serverService.getTmpConfig() - this.serverService.getConfig().subscribe( - config => this.serverConfig = config, - - err => this.notifier.error(err.message) - ) - } - - get routerLink () { - if (this.isUserLoggedIn()) { - return [ '/videos/upload' ] - } else if (this.isRegistrationAllowed()) { - return [ '/signup' ] - } else { - return [ '/login', { fromUpload: true } ] - } } doSearch () { @@ -73,15 +53,6 @@ export class HeaderComponent implements OnInit { o.subscribe(() => this.router.navigate([ '/search' ], { queryParams })) } - isUserLoggedIn () { - return this.authService.isLoggedIn() - } - - isRegistrationAllowed () { - return this.serverConfig.signup.allowed && - this.serverConfig.signup.allowedForCurrentIP - } - private loadUserLanguagesIfNeeded (queryParams: any) { if (queryParams && queryParams.languageOneOf) return of(queryParams) -- cgit v1.2.3