From 446e2da600a8b3445a8afe4813c5eb3e38bd246c Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 22 Nov 2019 16:32:18 -0800 Subject: [PATCH] Fix navigating to your own user page from another (top right nav) - Fixes #331 --- ui/src/components/user.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ui/src/components/user.tsx b/ui/src/components/user.tsx index 361ce63..84656ce 100644 --- a/ui/src/components/user.tsx +++ b/ui/src/components/user.tsx @@ -178,6 +178,14 @@ export class User extends Component { } } + componentDidUpdate(lastProps: any, _lastState: UserState, _snapshot: any) { + // Necessary if you are on a post and you click another post (same route) + if (lastProps.location.pathname !== lastProps.history.location.pathname) { + // Couldnt get a refresh working. This does for now. + location.reload(); + } + } + render() { return (