Fixing map.

This commit is contained in:
Dessalines 2023-12-06 08:55:49 -05:00
parent d550fae703
commit ac12f56927

View file

@ -263,17 +263,16 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
community_id: getIdFromString(selectedCommunityChoice.value), community_id: getIdFromString(selectedCommunityChoice.value),
}, },
communitySearchOptions: [selectedCommunityChoice].concat( communitySearchOptions: [selectedCommunityChoice].concat(
( (this.props.initialCommunities?.map(communityToChoice) ?? []).filter(
this.props.initialCommunities?.map(cv => communityToChoice(cv)) ?? option => option.value !== selectedCommunityChoice.value,
[] ),
).filter(option => option.value !== selectedCommunityChoice.value),
), ),
}; };
} else { } else {
this.state = { this.state = {
...this.state, ...this.state,
communitySearchOptions: communitySearchOptions:
this.props.initialCommunities?.map(cv => communityToChoice(cv)) ?? [], this.props.initialCommunities?.map(communityToChoice) ?? [],
}; };
} }