1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Backport pull request #5732 from jellyfin-web/release-10.9.z

Fix dashboard user page crash

Original-merge: 2d2d5bef94

Merged-by: thornbill <thornbill@users.noreply.github.com>

Backported-by: Bill Thornton <thornbill@users.noreply.github.com>
This commit is contained in:
thornbill 2024-07-21 01:53:28 -04:00 committed by Bill Thornton
parent fa9621e31a
commit c5b338dc64
8 changed files with 155 additions and 35 deletions

View file

@ -5,13 +5,19 @@
* @returns The url search string.
*/
export const getLocationSearch = () => {
// Check location.hash for a search string (this should be the case for our routing library)
let index = window.location.hash.indexOf('?');
if (index !== -1) {
return window.location.hash.substring(index);
}
// Return location.search if it exists
if (window.location.search) {
return window.location.search;
}
// Check the entire url in case the search string is in the hash
const index = window.location.href.indexOf('?');
// Fallback to checking the entire url
index = window.location.href.indexOf('?');
if (index !== -1) {
return window.location.href.substring(index);
}