UI: suppress API error toasts during restart (#32265)

This commit is contained in:
Michael Geers 2026-07-29 14:38:38 +02:00 • committed by GitHub
parent a3b14bb08f
commit 03a8c744d0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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();