refac
This commit is contained in:
@@ -484,13 +484,17 @@
|
|||||||
const dir = lastSlash > 0 ? filePath.substring(0, lastSlash + 1) : '/';
|
const dir = lastSlash > 0 ? filePath.substring(0, lastSlash + 1) : '/';
|
||||||
const fileName = filePath.substring(lastSlash + 1);
|
const fileName = filePath.substring(lastSlash + 1);
|
||||||
|
|
||||||
if (dir !== currentPath) {
|
// Always reload directory to ensure entries are fresh
|
||||||
await loadDir(dir);
|
await loadDir(dir);
|
||||||
}
|
|
||||||
|
|
||||||
await tick();
|
await tick();
|
||||||
|
|
||||||
const entry = entries.find((e) => e.name === fileName);
|
const entry = entries.find((e) => e.name === fileName);
|
||||||
if (entry) await openEntry(entry);
|
if (entry) {
|
||||||
|
await openEntry(entry);
|
||||||
|
} else {
|
||||||
|
// File may not be in listing; open it directly
|
||||||
|
await openEntry({ name: fileName, type: 'file', size: 0 });
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const unsubFileNavDir = showFileNavDir.subscribe(async (filePath) => {
|
const unsubFileNavDir = showFileNavDir.subscribe(async (filePath) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user