mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-05-20 04:30:17 +09:00
Merge pull request #4514 from SukkaW/fix-ls-performance
perf: avoid read localStorage on every render
This commit is contained in:
commit
51f7daaeaf
@ -405,7 +405,7 @@ export function MaskPage() {
|
|||||||
const chatStore = useChatStore();
|
const chatStore = useChatStore();
|
||||||
|
|
||||||
const [filterLang, setFilterLang] = useState<Lang | undefined>(
|
const [filterLang, setFilterLang] = useState<Lang | undefined>(
|
||||||
localStorage.getItem("Mask-language") as Lang | undefined,
|
() => localStorage.getItem("Mask-language") as Lang | undefined,
|
||||||
);
|
);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (filterLang) {
|
if (filterLang) {
|
||||||
|
Loading…
Reference in New Issue
Block a user