mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-21 00:06:35 +00:00
Split only on first comma in media browser (#12331)
This commit is contained in:
parent
30b130ca74
commit
7723d47ac1
@ -170,11 +170,12 @@ class PanelMediaBrowser extends LitElement {
|
|||||||
media_content_id: undefined,
|
media_content_id: undefined,
|
||||||
},
|
},
|
||||||
...navigateIdsEncoded.map((navigateId) => {
|
...navigateIdsEncoded.map((navigateId) => {
|
||||||
const [media_content_type, media_content_id] =
|
const decoded = decodeURIComponent(navigateId);
|
||||||
decodeURIComponent(navigateId).split(",");
|
// Don't use split because media_content_id could contain commas
|
||||||
|
const delimiter = decoded.indexOf(",");
|
||||||
return {
|
return {
|
||||||
media_content_type,
|
media_content_type: decoded.substring(0, delimiter),
|
||||||
media_content_id,
|
media_content_id: decoded.substring(delimiter + 1),
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
];
|
];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user