Interactive interface for browsing global, full-resolution satellite imagery
dont trigger pop-up blockers
Jason Kent1726b1261ff1
diff --git a/web/js/containers/share.js b/web/js/containers/share.jsindex 1e8e1e2d9..11b1d155b 100644--- a/web/js/containers/share.js+++ b/web/js/containers/share.js@@ -144,15 +144,17 @@ class ShareLinkContainer extends Component {});// If a short link can be generated, replace the full link.- if (type === 'twitter' || type === 'email') {- this.getShortLink()- .then(({ data }) => {- shareLink = getSharelink(type, data.url);- })- .catch(() => {- console.warn('Unable to shorten URL, full link generated.');- })- .finally(() => window.open(shareLink, '_blank'));+ if (type === 'twitter') {+ const newTab = window.open('', '_blank');+ this.getShortLink().then(({ data }) => {+ shareLink = getSharelink(type, data.url);+ newTab.location = shareLink;+ });+ } else if (type === 'email') {+ this.getShortLink().then(({ data }) => {+ shareLink = getSharelink(type, data.url);+ window.location = shareLink;+ });} else {window.open(shareLink, '_blank');}