Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/bundles/files/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,20 @@ const actions = () => ({
const isConnected = store.selectIpfsConnected()
const isFetching = store.selectFilesIsFetching()
const info = store.selectFilesPathInfo()
if (isReady && isConnected && !isFetching && info) {
if (!isReady || !isConnected || !info || isFetching) return

try {
await store.doFetch(info)
} finally {
// Navigating away while a listing is in flight makes that navigation's own
// doFilesFetch() a no-op, because of the isFetching check above, and
// nothing else retries it. Without this the view keeps waiting on content
// for a path we already left. Runs on failure too, since a rejected fetch
// leaves the new path just as unfetched.
const current = store.selectFilesPathInfo()
if (current && current.path !== info.path) {
await store.doFilesFetch()
}
}
},

Expand Down
Loading