fix: skip deleted entries in navigation history
This commit is contained in:
+20
-10
@@ -304,14 +304,19 @@
|
||||
try {
|
||||
if (snapshot.nodeId) {
|
||||
const node = await wailsCall('GetNodeDetail', snapshot.nodeId)
|
||||
if (node) {
|
||||
await selectNode(node)
|
||||
activeTab = snapshot.tab || 'overview'
|
||||
if (activeTab === 'files' && fileItems.length === 0) {
|
||||
await loadFolder(node.id)
|
||||
}
|
||||
if (!node) {
|
||||
return false
|
||||
}
|
||||
await selectNode(node)
|
||||
activeTab = snapshot.tab || 'overview'
|
||||
if (activeTab === 'files' && fileItems.length === 0) {
|
||||
await loadFolder(node.id)
|
||||
}
|
||||
return true
|
||||
} else if (snapshot.section) {
|
||||
if (!systemViews.some(view => view.id === snapshot.section)) {
|
||||
return false
|
||||
}
|
||||
await selectSystemView(snapshot.section)
|
||||
if (snapshot.section === 'trash') {
|
||||
trashFolderId = snapshot.trashFolderId || ''
|
||||
@@ -319,7 +324,11 @@
|
||||
trashSelectedIds = []
|
||||
await refreshTrash()
|
||||
}
|
||||
return true
|
||||
}
|
||||
return false
|
||||
} catch (e) {
|
||||
return false
|
||||
} finally {
|
||||
restoringHistory = false
|
||||
}
|
||||
@@ -327,10 +336,11 @@
|
||||
|
||||
async function goBack() {
|
||||
if (closeTopModalForBack()) return
|
||||
const snapshot = navHistory[navHistory.length - 1]
|
||||
if (!snapshot) return
|
||||
navHistory = navHistory.slice(0, -1)
|
||||
await restoreNavigation(snapshot)
|
||||
while (navHistory.length > 0) {
|
||||
const snapshot = navHistory[navHistory.length - 1]
|
||||
navHistory = navHistory.slice(0, -1)
|
||||
if (await restoreNavigation(snapshot)) return
|
||||
}
|
||||
}
|
||||
|
||||
function handleMouseNav(e) {
|
||||
|
||||
Reference in New Issue
Block a user