Wait until externalID has been fetched to render "Make Public"

This commit is contained in:
Robbie Antenesse 2019-07-02 10:07:08 -06:00
parent bfb404575b
commit c607c0cf16
1 changed files with 19 additions and 14 deletions

View File

@ -56,6 +56,9 @@ export function renderLoginForm() {
export function renderMakePublic() {
const editSettingsTab = document.getElementById('editSettingsTab');
const { isPublic } = window.currentDictionary.settings;
let waitForSync = setInterval(() => {
if (window.currentDictionary.hasOwnProperty('externalID') && !isNaN(window.currentDictionary.externalID)) {
clearInterval(waitForSync);
const { externalID } = window.currentDictionary;
const editSettingsTabHTML = `<label>Make Public
<input type="checkbox" id="editIsPublic"${isPublic ? ' checked' : ''}><br>
@ -70,6 +73,8 @@ export function renderMakePublic() {
editSettingsTab.innerHTML += editSettingsTabHTML;
setupMakePublic();
}
}, 100);
}
export function renderAccountSettings() {