From ca145918fe3441ec02af7ddfd8fee1f91b901162 Mon Sep 17 00:00:00 2001
From: Greg Fodor <gfodor@gmail.com>
Date: Sun, 14 Oct 2018 19:22:37 +0000
Subject: [PATCH] Always use same short link

---
 src/react-components/invite-dialog.js | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/react-components/invite-dialog.js b/src/react-components/invite-dialog.js
index 97d01aee9..414194081 100644
--- a/src/react-components/invite-dialog.js
+++ b/src/react-components/invite-dialog.js
@@ -43,11 +43,11 @@ export default class InviteDialog extends Component {
     const { entryCode } = this.props;
 
     const entryCodeString = pad(entryCode, 6);
-    const shareShortLink = `hub.link/${this.props.hubId}`;
-    const shareFullLink = [location.protocol, "//", "hub.link", location.pathname].join("");
+    const shortLinkText = `hub.link/${this.props.hubId}`;
+    const shortLink = "https://" + shortLinkText;
 
     const tweetText = `Join me now in #hubs!`;
-    const tweetLink = `https://twitter.com/share?url=${encodeURIComponent(shareShortLink)}&text=${encodeURIComponent(
+    const tweetLink = `https://twitter.com/share?url=${encodeURIComponent(shortLink)}&text=${encodeURIComponent(
       tweetText
     )}`;
 
@@ -75,15 +75,15 @@ export default class InviteDialog extends Component {
           <FormattedMessage id="invite.or_visit" />
         </div>
         <div className={styles.domain}>
-          <input type="text" readOnly onFocus={e => e.target.select()} value={shareShortLink} />
+          <input type="text" readOnly onFocus={e => e.target.select()} value={shortLinkText} />
         </div>
         <div className={styles.buttons}>
-          <button className={styles.linkButton} onClick={this.copyClicked.bind(this, "https://" + shareShortLink)}>
+          <button className={styles.linkButton} onClick={this.copyClicked.bind(this, shortLink)}>
             <span>{this.state.copyButtonActive ? "copied!" : "copy"}</span>
           </button>
           {this.props.allowShare &&
             navigator.share && (
-              <button className={styles.linkButton} onClick={this.shareClicked.bind(this, shareFullLink)}>
+              <button className={styles.linkButton} onClick={this.shareClicked.bind(this, shortLink)}>
                 <span>{this.state.shareButtonActive ? "sharing..." : "share"}</span>
               </button>
             )}
-- 
GitLab