Merge pull request #3508 from reece00/Mask-language

The language filtering option of the mask is stored
This commit is contained in:
DeanYao 2024-03-27 19:58:30 +08:00 committed by GitHub
commit c93b36fe79
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 1 deletions

View File

@ -404,7 +404,16 @@ export function MaskPage() {
const maskStore = useMaskStore(); const maskStore = useMaskStore();
const chatStore = useChatStore(); 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 const allMasks = maskStore
.getAll() .getAll()