From: Alec Armbruster Date: Fri, 16 Jun 2023 22:51:51 +0000 (-0400) Subject: pull latest main X-Git-Url: http://these/git/?a=commitdiff_plain;h=05aa483d899f83b231259fd0072c243c6567b922;hp=-c;p=lemmy-ui.git pull latest main --- 05aa483d899f83b231259fd0072c243c6567b922 diff --combined src/shared/components/person/settings.tsx index 564daff,56d57a7..3c8e9fc --- a/src/shared/components/person/settings.tsx +++ b/src/shared/components/person/settings.tsx @@@ -18,13 -18,13 +18,12 @@@ import Choice, capitalizeFirstLetter, communityToChoice, - debounce, elementUrl, emDash, enableNsfw, fetchCommunities, fetchThemeList, fetchUsers, - getLanguages, myAuth, myAuthRequired, personToChoice, @@@ -37,7 -37,6 +36,7 @@@ updateCommunityBlock, updatePersonBlock, } from "../../utils"; +import { debounce } from "../../utils/helpers/debounce"; import { HtmlTags } from "../common/html-tags"; import { Icon, Spinner } from "../common/icon"; import { ImageUploadForm } from "../common/image-upload-form"; @@@ -1058,12 -1057,12 +1057,12 @@@ export class Settings extends Component } handleInterfaceLangChange(i: Settings, event: any) { + const newLang = event.target.value ?? "browser"; + i18n.changeLanguage(newLang === "browser" ? navigator.languages : newLang); + i.setState( s => ((s.saveUserSettingsForm.interface_language = event.target.value), s) ); - i18n.changeLanguage( - getLanguages(i.state.saveUserSettingsForm.interface_language).at(0) - ); } handleDiscussionLanguageChange(val: number[]) { diff --combined src/shared/components/post/post.tsx index 2c61f79,05e4d9b..a471e64 --- a/src/shared/components/post/post.tsx +++ b/src/shared/components/post/post.tsx @@@ -64,6 -64,7 +64,6 @@@ import buildCommentsTree, commentsToFlatNodes, commentTreeMaxDepth, - debounce, editComment, editWith, enableDownvotes, @@@ -83,7 -84,6 +83,7 @@@ updatePersonBlock, } from "../../utils"; import { isBrowser } from "../../utils/browser/is-browser"; +import { debounce } from "../../utils/helpers/debounce"; import { CommentForm } from "../comment/comment-form"; import { CommentNodes } from "../comment/comment-nodes"; import { HtmlTags } from "../common/html-tags"; @@@ -552,7 -552,6 +552,6 @@@ export class Post extends Component { - if ( - s.postRes.state == "success" && - blockCommunityRes.state == "success" - ) { - s.postRes.data.community_view = blockCommunityRes.data.community_view; - } - return s; - }); - if (blockCommunityRes.state == "success") { updateCommunityBlock(blockCommunityRes.data); + this.setState(s => { + if (s.postRes.state == "success") { + s.postRes.data.community_view.blocked = + blockCommunityRes.data.blocked; + } + }); } }