mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
parent
f5994d2ae5
commit
62f6766e1b
@ -84,5 +84,9 @@ export const fetchInstallationType = async (): Promise<InstallationType> => {
|
|||||||
throw Error("unauthorized");
|
throw Error("unauthorized");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (response.status === 404) {
|
||||||
|
throw Error("not_found");
|
||||||
|
}
|
||||||
|
|
||||||
return response.json();
|
return response.json();
|
||||||
};
|
};
|
||||||
|
@ -286,7 +286,7 @@ class HaOnboarding extends litLocalizeLiteMixin(HassElement) {
|
|||||||
try {
|
try {
|
||||||
const response = await (window.stepsPromise || fetchOnboardingOverview());
|
const response = await (window.stepsPromise || fetchOnboardingOverview());
|
||||||
|
|
||||||
if (response.status === 404) {
|
if (response.status === 401 || response.status === 404) {
|
||||||
// We don't load the component when onboarding is done
|
// We don't load the component when onboarding is done
|
||||||
document.location.assign("/");
|
document.location.assign("/");
|
||||||
return;
|
return;
|
||||||
|
@ -62,7 +62,10 @@ class OnboardingRestoreBackup extends LitElement {
|
|||||||
try {
|
try {
|
||||||
await fetchInstallationType();
|
await fetchInstallationType();
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
if ((err as Error).message === "unauthorized") {
|
if (
|
||||||
|
(err as Error).message === "unauthorized" ||
|
||||||
|
(err as Error).message === "not_found"
|
||||||
|
) {
|
||||||
window.location.replace("/");
|
window.location.replace("/");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user