Skip to content

Commit

Permalink
perf: avoid read localStorage on every render
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW committed Apr 14, 2024
1 parent af3ebac commit 2322851
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/components/mask.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 2322851

Please sign in to comment.