diff --git a/src/js/account/render.js b/src/js/account/render.js index b5d7046..7333389 100644 --- a/src/js/account/render.js +++ b/src/js/account/render.js @@ -56,20 +56,25 @@ export function renderLoginForm() { export function renderMakePublic() { const editSettingsTab = document.getElementById('editSettingsTab'); const { isPublic } = window.currentDictionary.settings; - const { externalID } = window.currentDictionary; - const editSettingsTabHTML = ` -

- Public Link:
- - Copy -

- `; - editSettingsTab.innerHTML += editSettingsTabHTML; - - setupMakePublic(); + let waitForSync = setInterval(() => { + if (window.currentDictionary.hasOwnProperty('externalID') && !isNaN(window.currentDictionary.externalID)) { + clearInterval(waitForSync); + const { externalID } = window.currentDictionary; + const editSettingsTabHTML = ` +

+ Public Link:
+ + Copy +

+ `; + editSettingsTab.innerHTML += editSettingsTabHTML; + + setupMakePublic(); + } + }, 100); } export function renderAccountSettings() {