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
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 });
}
}
}

11
ui/src/utils.ts vendored
View 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),