Some small fixes.

This commit is contained in:
Dessalines 2020-07-30 14:25:01 -04:00
parent dc4ac6345c
commit 90ae426e24
2 changed files with 10 additions and 4 deletions

View 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 // This only finishes this form, if the randomly generated form_id matches the one received
if (this.state.commentForm.form_id == data.form_id) { if (this.state.commentForm.form_id == data.form_id) {
this.setState({ finished: true }); this.setState({ finished: true });
// Necessary because it broke tribute for some reaso
this.setState({ finished: false });
} }
} }
} }

11
ui/src/utils.ts vendored
View file

@ -588,6 +588,9 @@ export function messageToastify(
export function setupTribute(): Tribute { export function setupTribute(): Tribute {
return new Tribute({ return new Tribute({
noMatchTemplate: function () {
return '';
},
collection: [ collection: [
// Emojis // Emojis
{ {
@ -669,7 +672,7 @@ function userSearch(text: string, cb: any) {
WebSocketService.Instance.search(form); WebSocketService.Instance.search(form);
this.userSub = WebSocketService.Instance.subject.subscribe( let userSub = WebSocketService.Instance.subject.subscribe(
msg => { msg => {
let res = wsJsonToRes(msg); let res = wsJsonToRes(msg);
if (res.op == UserOperation.Search) { if (res.op == UserOperation.Search) {
@ -683,7 +686,7 @@ function userSearch(text: string, cb: any) {
}; };
}); });
cb(users); cb(users);
this.userSub.unsubscribe(); userSub.unsubscribe();
} }
}, },
err => console.error(err), err => console.error(err),
@ -706,7 +709,7 @@ function communitySearch(text: string, cb: any) {
WebSocketService.Instance.search(form); WebSocketService.Instance.search(form);
this.communitySub = WebSocketService.Instance.subject.subscribe( let communitySub = WebSocketService.Instance.subject.subscribe(
msg => { msg => {
let res = wsJsonToRes(msg); let res = wsJsonToRes(msg);
if (res.op == UserOperation.Search) { if (res.op == UserOperation.Search) {
@ -720,7 +723,7 @@ function communitySearch(text: string, cb: any) {
}; };
}); });
cb(communities); cb(communities);
this.communitySub.unsubscribe(); communitySub.unsubscribe();
} }
}, },
err => console.error(err), err => console.error(err),