feat(multimonitor): Add simple multi-monitor support to open another study(#4178)

This commit is contained in:
Bill Wallace authored and GitHub committed 2025-01-13 10:49:08 -05:00
1 parent a4a6de07f4
commit 07c628e689
49 files changed
+1476 -367

No files matched your search

+7 -1
View File
@@ -3,13 +3,19 @@ import { useLocation } from 'react-router';
/**
* It returns a URLSearchParams of the query parameters in the URL, where the keys are
* either lowercase or maintain their case based on the lowerCaseKeys parameter.
* This will automatically include the hash parameters as preferred parameters
* @param {lowerCaseKeys:boolean} true to return lower case keys; false (default) to maintain casing;
* @returns {URLSearchParams}
*/
export default function useSearchParams(options = { lowerCaseKeys: false }) {
const { lowerCaseKeys } = options;
const searchParams = new URLSearchParams(useLocation().search);
const location = useLocation();
const searchParams = new URLSearchParams(location.search);
const hashParams = new URLSearchParams(location.hash?.substring(1) || '');
for (const [key, value] of hashParams) {
searchParams.set(key, value);
}
if (!lowerCaseKeys) {
return searchParams;
}