Skip to content

Commit

Permalink
use explicit domain if localhost
Browse files Browse the repository at this point in the history
  • Loading branch information
karussell committed Aug 4, 2023
1 parent e17dce4 commit e319686
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/sidebar/SettingsBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ export default function SettingsBox({ turnNavSettings }: { turnNavSettings: TNSe
<div
className={styles.copyLinkRow}
onClick={() => {
navigator.clipboard.writeText(window.location.href)
if (navigator.share) navigator.share({ url: window.location.href })
let url = window.location.href
if(window.location.href.startsWith("http://localhost"))
url = "https://navi.graphhopper.org" + window.location.pathname + window.location.search
navigator.clipboard.writeText(url)
if (navigator.share) navigator.share({ url: url })
setShowCopiedInfo(true)
setTimeout(function () {
setShowCopiedInfo(false)
Expand Down

0 comments on commit e319686

Please sign in to comment.