Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: avoid opening new tab when clicking on link to contact form #454

Merged
merged 2 commits into from
Nov 29, 2024

Conversation

jonasbrunvoll
Copy link
Contributor

Avoid opening a new TAB when clicking on the link in the footer to the new contact form.

Copy link

vercel bot commented Nov 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
planner-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 26, 2024 10:27am

@mortennordseth
Copy link
Contributor

Could we check if the url is external instead of making this org-specific?

const urlHostname = new URL(url).hostname;
return urlHostname !== currentHostname;
} catch {
return false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this in a try..catch in case window isn't defined?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The try..catch is there to ensure that the function does not crash in case an invalid URL is provided.

@jonasbrunvoll jonasbrunvoll merged commit 102a3fa into main Nov 29, 2024
5 checks passed
@jonasbrunvoll jonasbrunvoll deleted the jonas/not_new_tab branch November 29, 2024 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants