diff --git a/app/components/chat-list.tsx b/app/components/chat-list.tsx index 33967717d53..7ef6e7b8337 100644 --- a/app/components/chat-list.tsx +++ b/app/components/chat-list.tsx @@ -12,7 +12,7 @@ import { import { useChatStore } from "../store"; import Locale from "../locales"; -import { Link, useNavigate } from "react-router-dom"; +import { Link, useLocation, useNavigate } from "react-router-dom"; import { Path } from "../constant"; import { MaskAvatar } from "./mask"; import { Mask } from "../store/mask"; @@ -40,12 +40,16 @@ export function ChatItem(props: { }); } }, [props.selected]); + + const { pathname: currentPath } = useLocation(); return ( {(provided) => (
{ diff --git a/app/components/mask.tsx b/app/components/mask.tsx index 218a4af6db1..32a16c9424c 100644 --- a/app/components/mask.tsx +++ b/app/components/mask.tsx @@ -404,7 +404,16 @@ export function MaskPage() { const maskStore = useMaskStore(); const chatStore = useChatStore(); - const [filterLang, setFilterLang] = useState(); + const [filterLang, setFilterLang] = useState( + 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() diff --git a/app/utils/cloud/webdav.ts b/app/utils/cloud/webdav.ts index bc569de0ec4..e01c193fea2 100644 --- a/app/utils/cloud/webdav.ts +++ b/app/utils/cloud/webdav.ts @@ -18,8 +18,15 @@ export function createWebDavClient(store: SyncStore) { method: "MKCOL", headers: this.headers(), }); - console.log("[WebDav] check", res.status, res.statusText); - return [201, 200, 404, 301, 302, 307, 308].includes(res.status); + const success = [201, 200, 404, 405, 301, 302, 307, 308].includes( + res.status, + ); + console.log( + `[WebDav] check ${success ? "success" : "failed"}, ${res.status} ${ + res.statusText + }`, + ); + return success; } catch (e) { console.error("[WebDav] failed to check", e); }