1234567891011121314151617181920212223242526272829303132 |
- export function extraQueryParameter(): URLSearchParams {
- const extraQueryString = window.SandboxData?.extraQueryString || '';
- const extraQuery = new URLSearchParams(extraQueryString);
- return extraQuery;
- }
- export function extraQueryParameterWithEmail(): URLSearchParams {
- const params = extraQueryParameter();
- const email = localStorage.getItem('email');
- if (email) {
- params.append('email', email);
- }
- return params;
- }
- export function extraQueryParameterWithEmailV2(): URLSearchParams {
- const params = extraQueryParameter();
- const email = localStorage.getItem('email');
- if (email) {
- params.append('email', email);
- }
- params.append('referrer', 'sandbox-walkthrough');
- return params;
- }
- export function urlAttachQueryParams(url: string, params: URLSearchParams): string {
- const queryString = params.toString();
- if (queryString) {
- return url + '?' + queryString;
- }
- return url;
- }
|