mirror of
https://github.com/fankes/beszel.git
synced 2025-10-19 17:59:28 +08:00
supress pocketbase auto cancellation error
This commit is contained in:
@@ -43,13 +43,20 @@ const verifyAuth = () => {
|
||||
}
|
||||
|
||||
export const updateSystemList = async () => {
|
||||
const records = await pb
|
||||
.collection<SystemRecord>("systems")
|
||||
.getFullList({ sort: "+name", fields: "id,name,host,info,status" })
|
||||
if (records.length) {
|
||||
$systems.set(records)
|
||||
} else {
|
||||
verifyAuth()
|
||||
try {
|
||||
const records = await pb
|
||||
.collection<SystemRecord>("systems")
|
||||
.getFullList({ sort: "+name", fields: "id,name,host,info,status" })
|
||||
if (records.length) {
|
||||
$systems.set(records)
|
||||
} else {
|
||||
verifyAuth()
|
||||
}
|
||||
} catch (err) {
|
||||
// @ts-ignore supress pocketbase auto cancellation error
|
||||
if (err.isAbort) {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user