fix(frontend): 修复文件树点击切换竞态
This commit is contained in:
@@ -16,7 +16,10 @@ onMounted(() => {
|
||||
}
|
||||
if (!workspaceStore.activeFilePath && workspaceStore.fileTree.length === 0) {
|
||||
void editorStore.loadFile('/欢迎使用知笔知己.md').then(() => {
|
||||
workspaceStore.openFile('/欢迎使用知笔知己.md')
|
||||
// 默认文件加载期间用户可能已经点击了其他文件,不能覆盖用户的选择。
|
||||
if (!workspaceStore.activeFilePath && editorStore.currentFilePath === '/欢迎使用知笔知己.md') {
|
||||
workspaceStore.openFile('/欢迎使用知笔知己.md')
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user