@@ -61,7 +61,7 @@ const Header: FC = () => {
61
61
62
62
useEffect ( ( ) => {
63
63
64
- if ( headerInit . current ) {
64
+ if ( headerInit . current || ! profileReady ) {
65
65
return
66
66
}
67
67
@@ -82,27 +82,20 @@ const Header: FC = () => {
82
82
toolName : activeToolName ,
83
83
toolRoute : activeToolRoute ,
84
84
type : 'tool' ,
85
+ user : profile ? {
86
+ handle : profile . handle ,
87
+ initials : `${ profile . firstName . charAt ( 0 ) } ${ profile . lastName . charAt ( 0 ) } ` ,
88
+ photoURL : profile . photoURL ,
89
+ userId : profile . userId ,
90
+ } : undefined ,
85
91
} ,
86
92
)
87
93
} , [
88
94
activeToolName ,
89
95
activeToolRoute ,
90
96
navigationHandler ,
91
- ] )
92
-
93
- useEffect ( ( ) => {
94
-
95
- tcUniNav (
96
- 'update' ,
97
- navElementId ,
98
- {
99
- toolName : activeToolName ,
100
- toolRoute : activeToolRoute ,
101
- } ,
102
- )
103
- } , [
104
- activeToolName ,
105
- activeToolRoute ,
97
+ profile ,
98
+ profileReady ,
106
99
] )
107
100
108
101
useEffect ( ( ) => {
@@ -115,17 +108,14 @@ const Header: FC = () => {
115
108
'update' ,
116
109
navElementId ,
117
110
{
118
- user : profile ? {
119
- handle : profile . handle ,
120
- initials : `${ profile . firstName . charAt ( 0 ) } ${ profile . lastName . charAt ( 0 ) } ` ,
121
- photoURL : profile . photoURL ,
122
- userId : profile . userId ,
123
- } : undefined ,
111
+ toolName : activeToolName ,
112
+ toolRoute : activeToolRoute ,
124
113
} ,
125
114
)
126
115
} , [
116
+ activeToolName ,
117
+ activeToolRoute ,
127
118
profileReady ,
128
- profile ,
129
119
] )
130
120
131
121
return (
0 commit comments