Skip to content

Commit

Permalink
Merge pull request #315 from nulib/4574-user-login-ai-queryparam
Browse files Browse the repository at this point in the history
Encode the URI for login coming from generative AI checkbox
  • Loading branch information
adamjarling authored Mar 7, 2024
2 parents 54a47b3 + 7129236 commit 204a80f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hooks/useGenerativeAISearchToggle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ export default function useGenerativeAISearchToggle() {
function goToLocation() {
const currentUrl = `${window.location.origin}${router.asPath}`;
const url = new URL(currentUrl);

url.searchParams.set(aiQueryParam, "true");
return url.toString();
const encodedUri = encodeURIComponent(url.href);
return encodedUri;
}

function closeDialog() {
Expand Down

0 comments on commit 204a80f

Please sign in to comment.