mirror of
https://github.com/muerwre/markdown-home-tab.git
synced 2025-04-25 00:46:41 +07:00
add sync storage
This commit is contained in:
parent
b0665bfb2a
commit
6d00bffbec
14 changed files with 164 additions and 82 deletions
|
@ -30,7 +30,10 @@ export const MarkdownEditorContainer: FC<MarkdownEditorContainerProps> = ({
|
|||
settings: { richEditorEnabled },
|
||||
} = useSettings();
|
||||
|
||||
const [value, setValue] = usePersistedValue(id, "MarkdownEditorContainer");
|
||||
const { value, setValue, hydrated } = usePersistedValue(
|
||||
id,
|
||||
"MarkdownEditorContainer"
|
||||
);
|
||||
|
||||
const empty = !value.trim();
|
||||
|
||||
|
@ -52,7 +55,7 @@ export const MarkdownEditorContainer: FC<MarkdownEditorContainerProps> = ({
|
|||
|
||||
return (
|
||||
<div className={styles.editor}>
|
||||
<Suspense>{locked ? viewer : editor}</Suspense>
|
||||
{hydrated && <Suspense>{locked ? viewer : editor}</Suspense>}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue