Skip to content

Commit

Permalink
Merge pull request ChatGPTNextWeb#3508 from reece00/Mask-language
Browse files Browse the repository at this point in the history
The language filtering option of the mask is stored
  • Loading branch information
Dean-YZG authored Mar 27, 2024
2 parents 0de9242 + 1442337 commit c93b36f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/components/mask.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,16 @@ export function MaskPage() {
const maskStore = useMaskStore();
const chatStore = useChatStore();

const [filterLang, setFilterLang] = useState<Lang>();
const [filterLang, setFilterLang] = useState<Lang | undefined>(
localStorage.getItem("Mask-language") as Lang | undefined,
);
useEffect(() => {
if (filterLang) {
localStorage.setItem("Mask-language", filterLang);
} else {
localStorage.removeItem("Mask-language");
}
}, [filterLang]);

const allMasks = maskStore
.getAll()
Expand Down

0 comments on commit c93b36f

Please sign in to comment.