fix local markdown attachment regressions
This commit is contained in:
@@ -26,6 +26,21 @@ export const createSidebarPageTreeRuntime = (dependencies = {}) => {
|
||||
var draggingPageNodeId = '';
|
||||
var activePageDropRow = null;
|
||||
|
||||
function localCreateSelectionOptions(result) {
|
||||
var selectTarget = result && result.selectTarget && typeof result.selectTarget === 'object'
|
||||
? result.selectTarget
|
||||
: result && result.revealTarget && typeof result.revealTarget === 'object'
|
||||
? result.revealTarget
|
||||
: null;
|
||||
if (!selectTarget) return { scrollIntoView: true };
|
||||
return {
|
||||
scrollIntoView: true,
|
||||
rootUri: result.rootUri || '',
|
||||
relativePath: selectTarget.relativePath || selectTarget.relative_path || '',
|
||||
rowId: selectTarget.rowId || selectTarget.row_id || ''
|
||||
};
|
||||
}
|
||||
|
||||
function navigateToDocument(nodeId, workspaceId, options) {
|
||||
if (!nodeId) return;
|
||||
var treeView = normalizeSidebarTreeMode(options && options.treeView ? options.treeView : activeSidebarTreeMode());
|
||||
@@ -111,7 +126,7 @@ export const createSidebarPageTreeRuntime = (dependencies = {}) => {
|
||||
if (typeof refreshLocalFolderAfterCommand === 'function') {
|
||||
await refreshLocalFolderAfterCommand('create', result, { parentId: effectiveParentId || null });
|
||||
}
|
||||
selectSidebarFileTreeDocument(nextDocumentId, { scrollIntoView: true });
|
||||
selectSidebarFileTreeDocument(nextDocumentId, localCreateSelectionOptions(result));
|
||||
document.documentElement.setAttribute('data-mnote-create-page-selected-document-id', nextDocumentId);
|
||||
}
|
||||
navigateToDocument(nextDocumentId, nextWorkspaceId, { treeView: activeSidebarTreeMode() });
|
||||
|
||||
Reference in New Issue
Block a user