From f10346a1c8bf53e9c7865f76663037163122c39b Mon Sep 17 00:00:00 2001 From: John Watson Date: Wed, 21 Aug 2024 00:03:37 +0100 Subject: [PATCH] feat: add maintenance timeout to toast as 60s --- .../{MaintananceMode.vue => MaintenanceMode.vue} | 0 app/web/src/store/apis.ts | 10 +++++----- 2 files changed, 5 insertions(+), 5 deletions(-) rename app/web/src/components/toasts/{MaintananceMode.vue => MaintenanceMode.vue} (100%) diff --git a/app/web/src/components/toasts/MaintananceMode.vue b/app/web/src/components/toasts/MaintenanceMode.vue similarity index 100% rename from app/web/src/components/toasts/MaintananceMode.vue rename to app/web/src/components/toasts/MaintenanceMode.vue diff --git a/app/web/src/store/apis.ts b/app/web/src/store/apis.ts index de4905c7d9..57c79dc9fb 100644 --- a/app/web/src/store/apis.ts +++ b/app/web/src/store/apis.ts @@ -9,7 +9,7 @@ import { useAuthStore } from "@/store/auth.store"; import { useChangeSetsStore } from "@/store/change_sets.store"; import { trackEvent } from "@/utils/tracking"; import FiveHundredError from "@/components/toasts/FiveHundredError.vue"; -import MaintananceMode from "@/components/toasts/MaintananceMode.vue"; +import MaintenanceMode from "@/components/toasts/MaintenanceMode.vue"; // api base url - can use a proxy or set a full url let apiUrl: string; @@ -90,15 +90,15 @@ async function handle500(error: AxiosError) { return Promise.reject(error); } -async function handleMaintananceMode(error: AxiosError) { +async function handleMaintenanceMode(error: AxiosError) { if (error?.response?.status === 503) { const toast = useToast(); toast( { - component: MaintananceMode, + component: MaintenanceMode, }, { - timeout: false, + timeout: 60000, }, ); } @@ -108,7 +108,7 @@ async function handleMaintananceMode(error: AxiosError) { sdfApiInstance.interceptors.response.use(handleProxyTimeouts, handle500); sdfApiInstance.interceptors.response.use( handleForcedChangesetRedirection, - handleMaintananceMode, + handleMaintenanceMode, ); export const authApiInstance = Axios.create({