]> Untitled Git - lemmy.git/commitdiff
Fix navigating to your own user page from another (top right nav)
authorDessalines <tyhou13@gmx.com>
Sat, 23 Nov 2019 00:32:18 +0000 (16:32 -0800)
committerDessalines <tyhou13@gmx.com>
Sat, 23 Nov 2019 00:32:18 +0000 (16:32 -0800)
- Fixes #331

ui/src/components/user.tsx

index 361ce633a50a2c61af63e33c95e0f3bdd6f7b597..84656ce7e9f7a820812fcfe5426cd0e3e4539e4a 100644 (file)
@@ -178,6 +178,14 @@ export class User extends Component<any, UserState> {
     }
   }
 
+  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 (
       <div class="container">