mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Remove getWindowLocationSearch global and duplicate implementation
This commit is contained in:
parent
891c63a3da
commit
8e66ba315a
5 changed files with 16 additions and 29 deletions
13
src/utils/url.ts
Normal file
13
src/utils/url.ts
Normal file
|
@ -0,0 +1,13 @@
|
|||
export const getWindowLocationSearch = (win: Window | null | undefined) => {
|
||||
let search = (win || window).location.search;
|
||||
|
||||
if (!search) {
|
||||
const index = window.location.href.indexOf('?');
|
||||
|
||||
if (index != -1) {
|
||||
search = window.location.href.substring(index);
|
||||
}
|
||||
}
|
||||
|
||||
return search || '';
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue