fix: shadowing state variable dans openEditor + imports manquants pour deleteFile
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import { state } from './state.js';
|
import { state } from './state.js';
|
||||||
import { api } from './auth.js';
|
import { api } from './auth.js';
|
||||||
import { openFile } from './viewer.js';
|
import { openFile, showWelcome } from './viewer.js';
|
||||||
|
import { refreshSidebarForContext, refreshTagsForContext } from './sidebar.js';
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// File extension → Lucide icon mapping
|
// File extension → Lucide icon mapping
|
||||||
@@ -353,13 +354,13 @@ async function openEditor(vaultName, filePath) {
|
|||||||
extensions.push(oneDark);
|
extensions.push(oneDark);
|
||||||
}
|
}
|
||||||
|
|
||||||
const state = EditorState.create({
|
const cmState = EditorState.create({
|
||||||
doc: rawData.raw,
|
doc: rawData.raw,
|
||||||
extensions: extensions,
|
extensions: extensions,
|
||||||
});
|
});
|
||||||
|
|
||||||
state.editorView = new EditorView({
|
state.editorView = new EditorView({
|
||||||
state: state,
|
state: cmState,
|
||||||
parent: bodyEl,
|
parent: bodyEl,
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|||||||
Reference in New Issue
Block a user