From: Dessalines Date: Thu, 30 Jul 2020 18:25:01 +0000 (-0400) Subject: Some small fixes. X-Git-Url: http://these/git/%22https:/nerdica.net/photo/contact/80/%7Bicon?a=commitdiff_plain;h=90ae426e247665f9985e1c0740b185f1e513a835;p=lemmy.git Some small fixes. --- diff --git a/ui/src/components/comment-form.tsx b/ui/src/components/comment-form.tsx index 01222b27..5597f58e 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 55a0777a..2ef1d070 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),