diff --git a/assets/js/api.ts b/assets/js/api.ts index 0b0287725..549675ca8 100644 --- a/assets/js/api.ts +++ b/assets/js/api.ts @@ -1,5 +1,6 @@ import axios, { type AxiosResponse } from "axios"; import { openLoginModal } from "./components/Auth/auth"; +import restart from "./restart"; const { protocol, hostname, port, pathname } = window.location; @@ -29,6 +30,11 @@ const api = axios.create({ }); const errorInterceptor = (error: any) => { + // backend is expected to be unreachable during restart, don't alert + if (restart.restarting) { + return Promise.reject(error); + } + // handle unauthorized errors if (error.response?.status === 401) { openLoginModal();