Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.

Commit afd2163

Browse files
feat: display no blank avatar while user is loading
1 parent 802fcdb commit afd2163

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

studio/src/app/components/core/app-navigation-actions/app-navigation-actions.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ export class AppNavigationActions {
3737
@State()
3838
private photoUrl: string;
3939

40+
@State()
41+
private photoUrlLoaded: boolean = false;
42+
4043
@Event() private actionPublish: EventEmitter<void>;
4144

4245
constructor() {
@@ -52,6 +55,7 @@ export class AppNavigationActions {
5255

5356
this.userSubscription = this.userService.watch().subscribe((user: User) => {
5457
this.photoUrl = user && user.data ? user.data.photo_url : undefined;
58+
this.photoUrlLoaded = true;
5559
});
5660
}
5761

@@ -102,7 +106,7 @@ export class AppNavigationActions {
102106
}
103107

104108
private renderLoggedIn() {
105-
if (Utils.isLoggedIn(this.authUser)) {
109+
if (Utils.isLoggedIn(this.authUser) && this.photoUrlLoaded) {
106110
return <a class="ion-padding-end" onClick={(e: UIEvent) => this.openMenu(e)}>
107111
<app-avatar src={this.photoUrl}></app-avatar>
108112
</a>;

0 commit comments

Comments
 (0)