Fix undefined value checks in use_http_client_2 (#1230)
* fix: filter out undefined from posts * fix: emoji initialisation passing undefined * fix: || => ?? to be more explicit * linting --------- Co-authored-by: Alex Maras <alexmaras@gmail.com>
This commit is contained in:
parent
2529322afd
commit
1877f653f3
2 changed files with 2 additions and 2 deletions
|
@ -115,7 +115,7 @@ export class PostListings extends Component<PostListingsProps, any> {
|
|||
|
||||
removeDuplicates(): PostView[] {
|
||||
// Must use a spread to clone the props, because splice will fail below otherwise.
|
||||
const posts = [...this.props.posts];
|
||||
const posts = [...this.props.posts].filter(empty => empty);
|
||||
|
||||
// A map from post url to list of posts (dupes)
|
||||
const urlMap = new Map<string, PostView[]>();
|
||||
|
|
|
@ -1274,7 +1274,7 @@ export function initializeSite(site?: GetSiteResponse) {
|
|||
UserService.Instance.myUserInfo = site?.my_user;
|
||||
i18n.changeLanguage(getLanguages()[0]);
|
||||
if (site) {
|
||||
setupEmojiDataModel(site.custom_emojis);
|
||||
setupEmojiDataModel(site.custom_emojis ?? []);
|
||||
}
|
||||
setupMarkdown();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue