diff --git a/src/App.tsx b/src/App.tsx index 4d0d3af..ec5b99d 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -30,6 +30,7 @@ let theme = setHyperspaceTheme(getUserDefaultTheme()); interface IAppState { theme: any; showLayout: boolean; + avatarURL?: string; } class App extends Component { @@ -44,6 +45,7 @@ class App extends Component { showLayout: userLoggedIn() && !window.location.hash.includes("#/welcome") }; + this.setAvatarURL = this.setAvatarURL.bind(this); } componentWillMount() { @@ -85,6 +87,12 @@ class App extends Component { } } + setAvatarURL(avatarURL: string) { + this.setState({ + avatarURL + }); + } + render() { this.removeBodyBackground(); @@ -93,7 +101,9 @@ class App extends Component {
- {this.state.showLayout ? : null} + {this.state.showLayout ? ( + + ) : null} { - + + + { } alt="You" src={ - this.state.currentUser + this.props.avatarURL + ? this.props.avatarURL + : this.state.currentUser ? this.state.currentUser .avatar_static : "" @@ -733,8 +735,11 @@ export class AppLayout extends Component { { this.props.enqueueSnackbar( "Avatar updated successfully." ); + this.props.onAvatarUpdate( + currentAccount.avatar_static + ); }) .catch((err: Error) => { this.props.closeSnackbar("persistAvatar");