Wait until externalID has been fetched to render "Make Public"
This commit is contained in:
parent
ad8ca6addc
commit
2a00d3d5b9
|
@ -56,6 +56,9 @@ export function renderLoginForm() {
|
||||||
export function renderMakePublic() {
|
export function renderMakePublic() {
|
||||||
const editSettingsTab = document.getElementById('editSettingsTab');
|
const editSettingsTab = document.getElementById('editSettingsTab');
|
||||||
const { isPublic } = window.currentDictionary.settings;
|
const { isPublic } = window.currentDictionary.settings;
|
||||||
|
let waitForSync = setInterval(() => {
|
||||||
|
if (window.currentDictionary.hasOwnProperty('externalID') && !isNaN(window.currentDictionary.externalID)) {
|
||||||
|
clearInterval(waitForSync);
|
||||||
const { externalID } = window.currentDictionary;
|
const { externalID } = window.currentDictionary;
|
||||||
const editSettingsTabHTML = `<label>Make Public
|
const editSettingsTabHTML = `<label>Make Public
|
||||||
<input type="checkbox" id="editIsPublic"${isPublic ? ' checked' : ''}><br>
|
<input type="checkbox" id="editIsPublic"${isPublic ? ' checked' : ''}><br>
|
||||||
|
@ -70,6 +73,8 @@ export function renderMakePublic() {
|
||||||
editSettingsTab.innerHTML += editSettingsTabHTML;
|
editSettingsTab.innerHTML += editSettingsTabHTML;
|
||||||
|
|
||||||
setupMakePublic();
|
setupMakePublic();
|
||||||
|
}
|
||||||
|
}, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function renderAccountSettings() {
|
export function renderAccountSettings() {
|
||||||
|
|
Loading…
Reference in New Issue