Skip to content

Commit

Permalink
Merge pull request #4384 from systeminit/feat/add-maintenance-timeout…
Browse files Browse the repository at this point in the history
…-to-toast

feat: add maintenance timeout to toast as 60s
  • Loading branch information
johnrwatson authored Aug 20, 2024
2 parents cbae6d1 + 037118c commit 0dc6535
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/web/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ const filterToasts = (toasts: any[]) => {
if (t.content.component?.__name === "Conflict") {
return [t];
}
if (t.content.component?.__name === "MaintananceMode") {
if (t.content.component?.__name === "MaintenanceMode") {
return [t];
}
}
Expand Down
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 0dc6535

Please sign in to comment.