diff --git a/src/shared/components/person/settings.tsx b/src/shared/components/person/settings.tsx index 22bcd25f..860838d1 100644 --- a/src/shared/components/person/settings.tsx +++ b/src/shared/components/person/settings.tsx @@ -782,9 +782,18 @@ export class Settings extends Component { this.blockPersonChoices.passedElement.element.addEventListener( "search", debounce(async (e: any) => { - let persons = (await fetchUsers(e.detail.value)).users; - let choices = persons.map(pvs => personToChoice(pvs)); - this.blockPersonChoices.setChoices(choices, "value", "label", true); + try { + let persons = (await fetchUsers(e.detail.value)).users; + let choices = persons.map(pvs => personToChoice(pvs)); + this.blockPersonChoices.setChoices( + choices, + "value", + "label", + true + ); + } catch (err) { + console.log(err); + } }, 400), false ); @@ -807,15 +816,19 @@ export class Settings extends Component { this.blockCommunityChoices.passedElement.element.addEventListener( "search", debounce(async (e: any) => { - let communities = (await fetchCommunities(e.detail.value)) - .communities; - let choices = communities.map(cv => communityToChoice(cv)); - this.blockCommunityChoices.setChoices( - choices, - "value", - "label", - true - ); + try { + let communities = (await fetchCommunities(e.detail.value)) + .communities; + let choices = communities.map(cv => communityToChoice(cv)); + this.blockCommunityChoices.setChoices( + choices, + "value", + "label", + true + ); + } catch (err) { + console.log(err); + } }, 400), false ); diff --git a/src/shared/components/post/post-form.tsx b/src/shared/components/post/post-form.tsx index 8c51c8c7..22f78c3f 100644 --- a/src/shared/components/post/post-form.tsx +++ b/src/shared/components/post/post-form.tsx @@ -586,14 +586,18 @@ export class PostForm extends Component { this.choices.passedElement.element.addEventListener( "search", debounce(async (e: any) => { - let communities = (await fetchCommunities(e.detail.value)) - .communities; - this.choices.setChoices( - communities.map(cv => communityToChoice(cv)), - "value", - "label", - true - ); + try { + let communities = (await fetchCommunities(e.detail.value)) + .communities; + this.choices.setChoices( + communities.map(cv => communityToChoice(cv)), + "value", + "label", + true + ); + } catch (err) { + console.log(err); + } }, 400), false ); diff --git a/src/shared/components/search.tsx b/src/shared/components/search.tsx index b70b12b0..52574891 100644 --- a/src/shared/components/search.tsx +++ b/src/shared/components/search.tsx @@ -778,11 +778,15 @@ export class Search extends Component { this.communityChoices.passedElement.element.addEventListener( "search", debounce(async (e: any) => { - let communities = (await fetchCommunities(e.detail.value)) - .communities; - let choices = communities.map(cv => communityToChoice(cv)); - choices.unshift({ value: "0", label: i18n.t("all") }); - this.communityChoices.setChoices(choices, "value", "label", true); + try { + let communities = (await fetchCommunities(e.detail.value)) + .communities; + let choices = communities.map(cv => communityToChoice(cv)); + choices.unshift({ value: "0", label: i18n.t("all") }); + this.communityChoices.setChoices(choices, "value", "label", true); + } catch (err) { + console.log(err); + } }, 400), false );