General improvements to verify_credentials
Signed-off-by: Marquis Kurt <software@marquiskurt.net>
This commit is contained in:
parent
91c1694560
commit
0c785fd11a
|
@ -62,7 +62,6 @@ class App extends Component<any, IAppState> {
|
|||
this.removeBodyBackground();
|
||||
this.unlisten = this.props.history.listen(
|
||||
(location: Location, action: any) => {
|
||||
console.log(location.pathname);
|
||||
this.setState({
|
||||
showLayout:
|
||||
userLoggedIn() &&
|
||||
|
|
|
@ -114,7 +114,7 @@ export class AppLayout extends Component<any, IAppLayoutState> {
|
|||
this.streamNotifications();
|
||||
}
|
||||
|
||||
private getAccountData() {
|
||||
getAccountData() {
|
||||
this.client
|
||||
.get("/accounts/verify_credentials")
|
||||
.then((resp: any) => {
|
||||
|
|
|
@ -95,22 +95,9 @@ export class Post extends React.Component<any, IPostState> {
|
|||
}
|
||||
|
||||
componentWillMount() {
|
||||
this.client
|
||||
.get("/accounts/verify_credentials")
|
||||
.then((resp: any) => {
|
||||
let account: Account = resp.data;
|
||||
this.setState({
|
||||
myAccount: account
|
||||
});
|
||||
})
|
||||
.catch((err: Error) => {
|
||||
console.error(err);
|
||||
this.setState({
|
||||
myAccount: JSON.parse(localStorage.getItem(
|
||||
"account"
|
||||
) as string)
|
||||
});
|
||||
});
|
||||
this.setState({
|
||||
myAccount: JSON.parse(localStorage.getItem("account") as string)
|
||||
});
|
||||
}
|
||||
|
||||
togglePostMenu() {
|
||||
|
|
Loading…
Reference in New Issue