perf: avoid read localStorage on every render

This commit is contained in:
SukkaW 2024-04-14 17:38:54 +08:00
parent af3ebacee6
commit 2322851ac4
1 changed files with 1 additions and 1 deletions

View File

@ -405,7 +405,7 @@ export function MaskPage() {
const chatStore = useChatStore();
const [filterLang, setFilterLang] = useState<Lang | undefined>(
localStorage.getItem("Mask-language") as Lang | undefined,
() => localStorage.getItem("Mask-language") as Lang | undefined,
);
useEffect(() => {
if (filterLang) {