mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-24 21:37:21 +00:00
Use startsWith for m shortcut for partial match (#12464)
This commit is contained in:
parent
ebc807a6a4
commit
307cd5ad8c
@ -41,15 +41,15 @@ export const getMyRedirects = (hasSupervisor: boolean): Redirects => ({
|
||||
component: "cloud",
|
||||
redirect: "/config/cloud",
|
||||
},
|
||||
integrations: {
|
||||
redirect: "/config/integrations",
|
||||
},
|
||||
config_flow_start: {
|
||||
redirect: "/config/integrations/add",
|
||||
params: {
|
||||
domain: "string",
|
||||
},
|
||||
},
|
||||
integrations: {
|
||||
redirect: "/config/integrations",
|
||||
},
|
||||
config_mqtt: {
|
||||
component: "mqtt",
|
||||
redirect: "/config/mqtt",
|
||||
@ -79,10 +79,6 @@ export const getMyRedirects = (hasSupervisor: boolean): Redirects => ({
|
||||
areas: {
|
||||
redirect: "/config/areas/dashboard",
|
||||
},
|
||||
blueprints: {
|
||||
component: "blueprint",
|
||||
redirect: "/config/blueprint/dashboard",
|
||||
},
|
||||
blueprint_import: {
|
||||
component: "blueprint",
|
||||
redirect: "/config/blueprint/dashboard/import",
|
||||
@ -90,6 +86,10 @@ export const getMyRedirects = (hasSupervisor: boolean): Redirects => ({
|
||||
blueprint_url: "url",
|
||||
},
|
||||
},
|
||||
blueprints: {
|
||||
component: "blueprint",
|
||||
redirect: "/config/blueprint/dashboard",
|
||||
},
|
||||
automations: {
|
||||
component: "automation",
|
||||
redirect: "/config/automation/dashboard",
|
||||
|
@ -73,7 +73,7 @@ export default <T extends Constructor<HassElement>>(superClass: T) =>
|
||||
for (const [slug, redirect] of Object.entries(
|
||||
myPanel.getMyRedirects(isComponentLoaded(this.hass, "hassio"))
|
||||
)) {
|
||||
if (redirect.redirect === targetPath) {
|
||||
if (targetPath.startsWith(redirect.redirect)) {
|
||||
window.open(
|
||||
`https://my.home-assistant.io/create-link/?redirect=${slug}`,
|
||||
"_blank"
|
||||
|
Loading…
x
Reference in New Issue
Block a user