🐛 fix initial load
This commit is contained in:
@@ -92,10 +92,12 @@ export function MarkdownEditor(): JSX.Element {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!editorRef.current) return
|
if (!editorRef.current) return
|
||||||
const isDark = theme === 'dark'
|
const isDark = theme === 'dark'
|
||||||
|
const { activeStoryContent, activeStoryPath } = useBorgesStore.getState()
|
||||||
|
lastPathRef.current = activeStoryPath
|
||||||
|
|
||||||
const view = new EditorView({
|
const view = new EditorView({
|
||||||
state: EditorState.create({
|
state: EditorState.create({
|
||||||
doc: '',
|
doc: activeStoryContent,
|
||||||
extensions: [
|
extensions: [
|
||||||
history(),
|
history(),
|
||||||
markdown(),
|
markdown(),
|
||||||
|
|||||||
Reference in New Issue
Block a user