From: Dessalines Date: Thu, 22 Sep 2022 18:13:22 +0000 (-0400) Subject: Adding a loading indicator for post community searching. Fixes #692 (#794) X-Git-Url: http://these/git/%7B%60/feeds/inbox/static/git-logo.png?a=commitdiff_plain;h=93bee57c4c82d3b53a7937779c47744a48210c34;p=lemmy-ui.git Adding a loading indicator for post community searching. Fixes #692 (#794) --- diff --git a/src/shared/components/modlog.tsx b/src/shared/components/modlog.tsx index 9eed9c9..556d84a 100644 --- a/src/shared/components/modlog.tsx +++ b/src/shared/components/modlog.tsx @@ -38,7 +38,7 @@ import { amAdmin, amMod, auth, - choicesModLogConfig, + choicesConfig, debounce, fetchLimit, fetchUsers, @@ -797,7 +797,7 @@ export class Modlog extends Component { if (isBrowser()) { let selectId: any = document.getElementById("filter-user"); if (selectId) { - this.userChoices = new Choices(selectId, choicesModLogConfig); + this.userChoices = new Choices(selectId, choicesConfig); this.userChoices.passedElement.element.addEventListener( "choice", (e: any) => { @@ -836,7 +836,7 @@ export class Modlog extends Component { if (isBrowser()) { let selectId: any = document.getElementById("filter-mod"); if (selectId) { - this.modChoices = new Choices(selectId, choicesModLogConfig); + this.modChoices = new Choices(selectId, choicesConfig); this.modChoices.passedElement.element.addEventListener( "choice", (e: any) => { diff --git a/src/shared/components/post/post-form.tsx b/src/shared/components/post/post-form.tsx index dd2c59f..8addc85 100644 --- a/src/shared/components/post/post-form.tsx +++ b/src/shared/components/post/post-form.tsx @@ -80,6 +80,7 @@ interface PostFormState { crossPosts: Option; loading: boolean; imageLoading: boolean; + communitySearchLoading: boolean; previewMode: boolean; } @@ -99,6 +100,7 @@ export class PostForm extends Component { }), loading: false, imageLoading: false, + communitySearchLoading: false, previewMode: false, suggestedTitle: None, suggestedPosts: None, @@ -366,7 +368,11 @@ export class PostForm extends Component { className="col-sm-2 col-form-label" htmlFor="post-community" > - {i18n.t("community")} + {this.state.communitySearchLoading ? ( + + ) : ( + i18n.t("community") + )}