WHAT IS THIS CONTEXT GRABBING OMG
This commit is contained in:
parent
85c0d4bab5
commit
8416078496
|
|
@ -1,3 +1,10 @@
|
|||
const COMPANY_ID_QUERY_KEYS = [
|
||||
'companyId',
|
||||
'company_id',
|
||||
'blt-gtw-fc-cid',
|
||||
'bltt-gtw-f-c-cid',
|
||||
];
|
||||
|
||||
function getRuntimeUrl() {
|
||||
if (typeof window === 'undefined') return null;
|
||||
|
||||
|
|
@ -39,9 +46,9 @@ export function getRuntimeCompanyId() {
|
|||
const referrerUrl = getReferrerUrl();
|
||||
|
||||
return (
|
||||
getFirstSearchParam(runtimeUrl, ['companyId', 'company_id', 'bltt-gtw-f-c-cid'])
|
||||
getFirstSearchParam(runtimeUrl, COMPANY_ID_QUERY_KEYS)
|
||||
|| getPathMatch(runtimeUrl?.pathname || '', /\/company\/([^/]+)/i)
|
||||
|| getFirstSearchParam(referrerUrl, ['companyId', 'company_id'])
|
||||
|| getFirstSearchParam(referrerUrl, COMPANY_ID_QUERY_KEYS)
|
||||
|| getPathMatch(referrerUrl?.pathname || '', /\/company\/([^/]+)/i)
|
||||
|| ''
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user