diff --git a/web/src/lib/stores/assets.store.ts b/web/src/lib/stores/assets.store.ts index 7dbe5d6b2d..3000a64b06 100644 --- a/web/src/lib/stores/assets.store.ts +++ b/web/src/lib/stores/assets.store.ts @@ -232,6 +232,10 @@ export class AssetStore { } } + if (bucket.cancelToken.signal.aborted) { + return; + } + bucket.assets = assets; this.emit(true); diff --git a/web/src/lib/utils/handle-error.ts b/web/src/lib/utils/handle-error.ts index be0c6d9802..8164f716a1 100644 --- a/web/src/lib/utils/handle-error.ts +++ b/web/src/lib/utils/handle-error.ts @@ -1,6 +1,5 @@ -import axios from 'axios'; -import { notificationController, NotificationType } from '../components/shared-components/notification/notification'; import type { HttpError } from '@sveltejs/kit'; +import { notificationController, NotificationType } from '../components/shared-components/notification/notification'; export async function getServerErrorMessage(error: unknown) { let data = (error as HttpError)?.body; @@ -17,7 +16,7 @@ export async function getServerErrorMessage(error: unknown) { } export async function handleError(error: unknown, message: string) { - if (axios.isCancel(error)) { + if ((error as Error)?.name === 'AbortError') { return; }