* Execute HackStack redirect after all loading is complete * @param {Object} redirectInfo - Redirect information from checkHackstackRedirect
(redirectInfo)
| 2620 | * @param {Object} redirectInfo - Redirect information from checkHackstackRedirect |
| 2621 | */ |
| 2622 | executeHackstackRedirect (redirectInfo) { |
| 2623 | if (redirectInfo) { |
| 2624 | try { |
| 2625 | // Use URL API to properly merge query parameters and hash |
| 2626 | const destUrl = new URL(redirectInfo.dest, window.location.origin) |
| 2627 | const currentUrl = new URL(window.location.href) |
| 2628 | // Merge query parameters |
| 2629 | currentUrl.searchParams.forEach((value, key) => { |
| 2630 | destUrl.searchParams.set(key, value) |
| 2631 | }) |
| 2632 | // Preserve hash fragment |
| 2633 | if (currentUrl.hash) { |
| 2634 | destUrl.hash = currentUrl.hash |
| 2635 | } |
| 2636 | application.router.navigate(destUrl.pathname + destUrl.search + destUrl.hash, { trigger: true, replace: true }) |
| 2637 | } catch (e) { |
| 2638 | // Fallback to simple concatenation if URL API fails |
| 2639 | const query = location.search || '' |
| 2640 | const hash = location.hash || '' |
| 2641 | application.router.navigate(`${redirectInfo.dest}${query}${hash}`, { trigger: true, replace: true }) |
| 2642 | } |
| 2643 | } |
| 2644 | } |
| 2645 | |
| 2646 | isJuniorCampaign () { |
| 2647 | const campaignObj = this.campaign || (typeof this.terrain === 'object' ? this.terrain : null) |
no test coverage detected