chore: fix editor cache

This commit is contained in:
Steven
2023-10-05 14:20:35 +08:00
parent 34ae9b0687
commit fd7043ea40
5 changed files with 12 additions and 7 deletions

View File

@ -23,6 +23,7 @@ const emptyOlReg = /^(\d+)\. $/;
interface Props {
className?: string;
cacheKey?: string;
memoId?: MemoId;
relationList?: MemoRelation[];
onConfirm?: () => void;
@ -37,10 +38,10 @@ interface State {
}
const MemoEditor = (props: Props) => {
const { className, memoId, onConfirm } = props;
const { className, cacheKey, memoId, onConfirm } = props;
const { i18n } = useTranslation();
const t = useTranslate();
const [contentCache, setContentCache] = useLocalStorage<string>(`memo-editor-${props.memoId || "0"}`, "");
const [contentCache, setContentCache] = useLocalStorage<string>(`memo-editor-${cacheKey}`, "");
const {
state: { systemStatus },
} = useGlobalStore();