]> Untitled Git - lemmy.git/commitdiff
Some small fixes.
authorDessalines <tyhou13@gmx.com>
Thu, 30 Jul 2020 18:25:01 +0000 (14:25 -0400)
committerDessalines <tyhou13@gmx.com>
Thu, 30 Jul 2020 18:25:01 +0000 (14:25 -0400)
ui/src/components/comment-form.tsx
ui/src/utils.ts

index 01222b27c10ca525ea671b73905cfc1bb43f1df6..5597f58ee5f3db89dcd8f5be47bc99dacbc1c796 100644 (file)
@@ -144,6 +144,9 @@ export class CommentForm extends Component<CommentFormProps, CommentFormState> {
         // 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 });
         }
       }
     }
index 55a0777ab1beca731da2e3dc55329ba9d5e5c0c1..2ef1d070c0fea3d28a3aa7617656bbc3d18a409f 100644 (file)
@@ -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),