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 committed by Robbie Antenesse
parent ad8ca6addc
commit 2a00d3d5b9
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>
@ -71,6 +74,8 @@ export function renderMakePublic() {
setupMakePublic();
}
}, 100);
}
export function renderAccountSettings() {
const accountSettingsColumn = document.getElementById('accountSettings');