Skip to content

Commit

Permalink
Merge pull request ChatGPTNextWeb#4514 from SukkaW/fix-ls-performance
Browse files Browse the repository at this point in the history
perf: avoid read localStorage on every render
  • Loading branch information
Dean-YZG authored Apr 15, 2024
2 parents 72c9683 + 25fd550 commit 069b7f4
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 069b7f4

Please sign in to comment.