Better exit navigation for my-ingress (#9342)

This commit is contained in:
Joakim Sørensen 2021-06-03 19:01:12 +02:00 committed by GitHub
parent bdef9fd040
commit e00bcc9f48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 3 deletions

View File

@ -97,16 +97,23 @@ class HassioIngressView extends LitElement {
title: requestedAddon, title: requestedAddon,
}); });
await nextRender(); await nextRender();
history.back(); navigate("/hassio/store", { replace: true });
return; return;
} }
if (!addonInfo.ingress) { if (!addonInfo.version) {
await showAlertDialog(this, {
text: this.supervisor.localize("my.error_addon_not_installed"),
title: addonInfo.name,
});
await nextRender();
navigate(`/hassio/addon/${addonInfo.slug}/info`, { replace: true });
} else if (!addonInfo.ingress) {
await showAlertDialog(this, { await showAlertDialog(this, {
text: this.supervisor.localize("my.error_addon_no_ingress"), text: this.supervisor.localize("my.error_addon_no_ingress"),
title: addonInfo.name, title: addonInfo.name,
}); });
await nextRender(); await nextRender();
history.back(); navigate(`/hassio/addon/${addonInfo.slug}/info`, { replace: true });
} else { } else {
navigate(`/hassio/ingress/${addonInfo.slug}`, { replace: true }); navigate(`/hassio/ingress/${addonInfo.slug}`, { replace: true });
} }

View File

@ -3813,6 +3813,8 @@
"faq_link": "[%key:ui::panel::my::faq_link%]", "faq_link": "[%key:ui::panel::my::faq_link%]",
"error": "[%key:ui::panel::my::error%]", "error": "[%key:ui::panel::my::error%]",
"error_addon_not_found": "Add-on not found", "error_addon_not_found": "Add-on not found",
"error_addon_not_started": "The requested add-on are not running. Please start it first",
"error_addon_not_installed": "The requested add-on is not installed. Please install it first",
"error_addon_no_ingress": "The requested add-on does not support ingress" "error_addon_no_ingress": "The requested add-on does not support ingress"
}, },
"system": { "system": {