From 2e84441e6635b42065ef646238a6c95aea207548 Mon Sep 17 00:00:00 2001
From: Dessalines <tyhou13@gmx.com>
Date: Mon, 27 Jan 2020 21:04:30 -0500
Subject: Strictly typing websocket forms.

---
 ui/src/components/community.tsx | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

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

diff --git a/ui/src/components/community.tsx b/ui/src/components/community.tsx
index 221c9211..3c5f6890 100644
--- a/ui/src/components/community.tsx
+++ b/ui/src/components/community.tsx
@@ -11,6 +11,7 @@ import {
   SortType,
   Post,
   GetPostsForm,
+  GetCommunityForm,
   ListingType,
   GetPostsResponse,
   CreatePostLikeResponse,
@@ -98,11 +99,11 @@ export class Community extends Component<any, State> {
         () => console.log('complete')
       );
 
-    if (this.state.communityId) {
-      WebSocketService.Instance.getCommunity(this.state.communityId);
-    } else if (this.state.communityName) {
-      WebSocketService.Instance.getCommunityByName(this.state.communityName);
-    }
+    let form: GetCommunityForm = {
+      id: this.state.communityId ? this.state.communityId : null,
+      name: this.state.communityName ? this.state.communityName : null,
+    };
+    WebSocketService.Instance.getCommunity(form);
   }
 
   componentWillUnmount() {
-- 
cgit v1.2.3

