@@ -49,42 +49,57 @@ type ProfileProps = {
4949 dispatch : Function ,
5050} ;
5151
52- const ProfileDropdown = ( props : ProfileProps ) => {
53- return (
54- < UserProfileDropdown className = { 'dropdown' } >
55- < UserProfileDropdownList >
56- { props . user . username && (
57- < Link rel = "nofollow" to = { `/users/${ props . user . username } /settings` } >
58- < UserProfileDropdownListItem >
59- My Settings
60- </ UserProfileDropdownListItem >
61- </ Link >
62- ) }
52+ type State = {
53+ didMount : boolean ,
54+ } ;
55+
56+ class ProfileDropdown extends React . Component < ProfileProps , State > {
57+ state = { didMount : false } ;
58+
59+ componentDidMount ( ) {
60+ return this . setState ( { didMount : true } ) ;
61+ }
6362
64- { isMac ( ) &&
65- ! isDesktopApp ( ) && (
66- < Link to = { `/apps` } >
63+ render ( ) {
64+ const { props } = this ;
65+ const { didMount } = this . state ;
66+ return (
67+ < UserProfileDropdown className = { 'dropdown' } >
68+ < UserProfileDropdownList >
69+ { props . user . username && (
70+ < Link rel = "nofollow" to = { `/users/${ props . user . username } /settings` } >
6771 < UserProfileDropdownListItem >
68- Desktop App
72+ My Settings
6973 </ UserProfileDropdownListItem >
7074 </ Link >
7175 ) }
7276
73- < Link to = { `/about` } >
74- < UserProfileDropdownListItem >
75- About Spectrum
76- </ UserProfileDropdownListItem >
77- </ Link >
78- < Link to = { `/support` } >
79- < UserProfileDropdownListItem > Support</ UserProfileDropdownListItem >
80- </ Link >
77+ { didMount &&
78+ isMac ( ) &&
79+ ! isDesktopApp ( ) && (
80+ < Link to = { `/apps` } >
81+ < UserProfileDropdownListItem >
82+ Desktop App
83+ </ UserProfileDropdownListItem >
84+ </ Link >
85+ ) }
8186
82- < a href = { `${ SERVER_URL } /auth/logout` } >
83- < UserProfileDropdownListItem > Log Out</ UserProfileDropdownListItem >
84- </ a >
85- </ UserProfileDropdownList >
86- </ UserProfileDropdown >
87- ) ;
88- } ;
87+ < Link to = { `/about` } >
88+ < UserProfileDropdownListItem >
89+ About Spectrum
90+ </ UserProfileDropdownListItem >
91+ </ Link >
92+ < Link to = { `/support` } >
93+ < UserProfileDropdownListItem > Support</ UserProfileDropdownListItem >
94+ </ Link >
95+
96+ < a href = { `${ SERVER_URL } /auth/logout` } >
97+ < UserProfileDropdownListItem > Log Out</ UserProfileDropdownListItem >
98+ </ a >
99+ </ UserProfileDropdownList >
100+ </ UserProfileDropdown >
101+ ) ;
102+ }
103+ }
89104
90105export default connect ( ) ( ProfileDropdown ) ;
0 commit comments