Skip to content

Commit

Permalink
feat: add maintenance timeout to toast as 60s
Browse files Browse the repository at this point in the history
  • Loading branch information
johnrwatson committed Aug 20, 2024
1 parent 1bb342e commit f10346a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/web/src/store/apis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
},
);
}
Expand All @@ -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({
Expand Down

0 comments on commit f10346a

Please sign in to comment.