From 90ae426e247665f9985e1c0740b185f1e513a835 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Thu, 30 Jul 2020 14:25:01 -0400 Subject: [PATCH] Some small fixes. --- ui/src/components/comment-form.tsx | 3 +++ ui/src/utils.ts | 11 +++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ui/src/components/comment-form.tsx b/ui/src/components/comment-form.tsx index 01222b27c..5597f58ee 100644 --- a/ui/src/components/comment-form.tsx +++ b/ui/src/components/comment-form.tsx @@ -144,6 +144,9 @@ export class CommentForm extends Component { // This only finishes this form, if the randomly generated form_id matches the one received if (this.state.commentForm.form_id == data.form_id) { this.setState({ finished: true }); + + // Necessary because it broke tribute for some reaso + this.setState({ finished: false }); } } } diff --git a/ui/src/utils.ts b/ui/src/utils.ts index 55a0777ab..2ef1d070c 100644 --- a/ui/src/utils.ts +++ b/ui/src/utils.ts @@ -588,6 +588,9 @@ export function messageToastify( export function setupTribute(): Tribute { return new Tribute({ + noMatchTemplate: function () { + return ''; + }, collection: [ // Emojis { @@ -669,7 +672,7 @@ function userSearch(text: string, cb: any) { WebSocketService.Instance.search(form); - this.userSub = WebSocketService.Instance.subject.subscribe( + let userSub = WebSocketService.Instance.subject.subscribe( msg => { let res = wsJsonToRes(msg); if (res.op == UserOperation.Search) { @@ -683,7 +686,7 @@ function userSearch(text: string, cb: any) { }; }); cb(users); - this.userSub.unsubscribe(); + userSub.unsubscribe(); } }, err => console.error(err), @@ -706,7 +709,7 @@ function communitySearch(text: string, cb: any) { WebSocketService.Instance.search(form); - this.communitySub = WebSocketService.Instance.subject.subscribe( + let communitySub = WebSocketService.Instance.subject.subscribe( msg => { let res = wsJsonToRes(msg); if (res.op == UserOperation.Search) { @@ -720,7 +723,7 @@ function communitySearch(text: string, cb: any) { }; }); cb(communities); - this.communitySub.unsubscribe(); + communitySub.unsubscribe(); } }, err => console.error(err),