1
- import { Component , OnDestroy , OnInit } from '@angular/core' ;
1
+ import { AfterViewInit , Component , OnDestroy , OnInit } from '@angular/core' ;
2
2
import { Observable , Subscription } from 'rxjs' ;
3
3
import { Bookmark } from '../../core/model/bookmark' ;
4
4
import { ActivatedRoute , Router } from '@angular/router' ;
@@ -27,7 +27,7 @@ import { MatTabChangeEvent } from '@angular/material/tabs';
27
27
templateUrl : './homepage.component.html' ,
28
28
styleUrls : [ './homepage.component.scss' ]
29
29
} )
30
- export class HomepageComponent extends TagFollowingBaseComponent implements OnInit , OnDestroy {
30
+ export class HomepageComponent extends TagFollowingBaseComponent implements OnInit , OnDestroy , AfterViewInit {
31
31
32
32
readonly FIRST_PAGE = 1 ;
33
33
@@ -42,6 +42,7 @@ export class HomepageComponent extends TagFollowingBaseComponent implements OnIn
42
42
readLater$ : Observable < Bookmark [ ] > ;
43
43
44
44
userIsLoggedIn = false ;
45
+ showLoginButton = false ;
45
46
userId : string ;
46
47
userIsLoggedIn$ : Promise < boolean > ;
47
48
@@ -252,6 +253,14 @@ export class HomepageComponent extends TagFollowingBaseComponent implements OnIn
252
253
queryParams : { q : '[' + tag + ']' , sd : SearchDomain . PUBLIC_BOOKMARKS , page : this . FIRST_PAGE }
253
254
} ) ;
254
255
}
256
+
257
+ ngAfterViewInit ( ) : void {
258
+ this . userIsLoggedIn$ . then ( isLoggedIn => {
259
+ if ( ! isLoggedIn ) {
260
+ this . showLoginButton = true ;
261
+ }
262
+ } ) ;
263
+ }
255
264
}
256
265
257
266
export interface TabSwitchQueryParams {
0 commit comments