Use domain + pathname for public links instead of href

This commit is contained in:
Robbie Antenesse 2019-05-29 00:01:59 -06:00 committed by Robbie Antenesse
parent 520ede111b
commit b59c4702b2
2 changed files with 2 additions and 2 deletions

View File

@ -63,7 +63,7 @@ export function renderMakePublic() {
</label>
<p id="publicLinkDisplay" style="${!isPublic ? 'display:none;': ''}margin-left:20px;">
<strong>Public Link:</strong><br>
<input readonly id="publicLink" value="${window.location.href + (externalID ? externalID.toString() : '')}">
<input readonly id="publicLink" value="${document.domain + window.location.pathname + (externalID ? externalID.toString() : '')}">
<a class="small button" id="publicLinkCopy">Copy</a>
</p>
`;

View File

@ -100,7 +100,7 @@ export function uploadWholeDictionary(asNew = false) {
dictionary,
}, remoteId => {
window.currentDictionary.externalID = remoteId;
dictionary.getElementById('publicLink').value = window.location.href + remoteId.toString();
dictionary.getElementById('publicLink').value = document.domain + window.location.pathname + remoteId.toString();
saveDictionary(false);
addMessage('Dictionary Uploaded Successfully');
renderChangeDictionaryOptions();