mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
parent
f5994d2ae5
commit
62f6766e1b
@ -84,5 +84,9 @@ export const fetchInstallationType = async (): Promise<InstallationType> => {
|
||||
throw Error("unauthorized");
|
||||
}
|
||||
|
||||
if (response.status === 404) {
|
||||
throw Error("not_found");
|
||||
}
|
||||
|
||||
return response.json();
|
||||
};
|
||||
|
@ -286,7 +286,7 @@ class HaOnboarding extends litLocalizeLiteMixin(HassElement) {
|
||||
try {
|
||||
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
|
||||
document.location.assign("/");
|
||||
return;
|
||||
|
@ -62,7 +62,10 @@ class OnboardingRestoreBackup extends LitElement {
|
||||
try {
|
||||
await fetchInstallationType();
|
||||
} catch (err: any) {
|
||||
if ((err as Error).message === "unauthorized") {
|
||||
if (
|
||||
(err as Error).message === "unauthorized" ||
|
||||
(err as Error).message === "not_found"
|
||||
) {
|
||||
window.location.replace("/");
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user