Skip to content

Commit

Permalink
fix(error): fix issue that loading screen persists when object is not…
Browse files Browse the repository at this point in the history
… found (#241)

close AlistGo/alist#7333
  • Loading branch information
Lanfei authored Jan 27, 2025
1 parent 3dce0a8 commit d9956e6
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/hooks/usePath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export const usePath = () => {
cancelObj?.()
cancelList?.()
retry_pass = rp ?? false
handleErr("")
ObjStore.setErr("")
if (hasHistory(path)) {
return recoverHistory(path)
} else if (IsDirRecord[path]) {
Expand Down Expand Up @@ -221,9 +221,15 @@ export const usePath = () => {
notify.error(msg)
}
} else {
if (first_fetch && msg.endsWith("object not found")) {
const basePath = me().base_path
if (
first_fetch &&
basePath != "/" &&
pathname().includes(basePath) &&
msg.endsWith("object not found")
) {
first_fetch = false
to(pathname().replace(me().base_path, ""))
to(pathname().replace(basePath, ""))
return
}
if (code === undefined || code >= 0) {
Expand Down

0 comments on commit d9956e6

Please sign in to comment.