perf: avoid read localStorage on every render
This commit is contained in:
parent
af3ebacee6
commit
2322851ac4
|
@ -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