Wait until externalID has been fetched to render "Make Public"
This commit is contained in:
parent
bfb404575b
commit
c607c0cf16
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue