General improvements to verify_credentials

Signed-off-by: Marquis Kurt <software@marquiskurt.net>
This commit is contained in:
Marquis Kurt 2019-10-03 16:35:26 -04:00
parent 91c1694560
commit 0c785fd11a
No known key found for this signature in database
GPG Key ID: 725636D259F5402D
3 changed files with 4 additions and 18 deletions

View File

@ -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() &&

View File

@ -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) => {

View File

@ -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() {