import { Component , ElementRef , NgZone , OnInit , ViewChild } from '@angular/core' ; import { SpinnerService } from '../../providers/spinner.service' ; import { ToolbarService } from '../../providers/toolbar.service' ; import { Login , TwitchAuthService } from '../../providers/twitch-auth-graphql.service' ; import { Router } from '@angular/router' ; @ Component ( { templateUrl : './login.component.html' , styleUrls : [ './login.component.scss' ] } ) export class LoginComponent implements OnInit { @ ViewChild ( 'webview' ) webview : ElementRef ; login : Login ; login_url = 'https://passport.twitch.tv/sessions/new?clientId=settings_page' ; constructor ( private toolbarService , private twitchAuthService , private spinnerService , private router , private ngZone ) { this . login = this . twitchAuthService . getLogin ( ) ; } ngOnInit ( ) { this . toolbarService . setTitle ( '' ) ; this . toolbarService . setLogo ( '' ) ; this . twitchAuthService . loginChange$ . subscribe ( ( login ) => { this . login = login ; } ) ; } logOut ( ) { this . twitchAuthService . logOut ( ) ; } }