From b0b50098a4079daa0622a1ff9b4c52774d1d1d9f Mon Sep 17 00:00:00 2001
From: Dessalines <tyhou13@gmx.com>
Date: Tue, 4 Feb 2020 11:19:05 -0500
Subject: Websocket reconnect reload page data. Fixes #504

---
 ui/src/components/post.tsx | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'ui/src/components/post.tsx')

diff --git a/ui/src/components/post.tsx b/ui/src/components/post.tsx
index b0faf850..b399d3b2 100644
--- a/ui/src/components/post.tsx
+++ b/ui/src/components/post.tsx
@@ -370,6 +370,10 @@ export class Post extends Component<any, PostState> {
     if (msg.error) {
       toast(i18n.t(msg.error), 'danger');
       return;
+    } else if (msg.reconnect) {
+      WebSocketService.Instance.getPost({
+        id: Number(this.props.match.params.id),
+      });
     } else if (res.op == UserOperation.GetPost) {
       let data = res.data as GetPostResponse;
       this.state.post = data.post;
-- 
cgit v1.2.3

