diff --git a/src/email-recovery.js b/src/email-recovery.js index 31f6e883fe3711a6445760830d140475d4b8be1b..93299f53173f896ec57ad60f56399ad23dfd2a38 100644 --- a/src/email-recovery.js +++ b/src/email-recovery.js @@ -7,11 +7,11 @@ document.addEventListener('DOMContentLoaded', function() { const contentDiv = document.createElement('div') contentDiv.id = 'recovery-email-banner-container' const textNode = createTextNode(APPLICATION_NAME) - // const link = createLinkElement(APPLICATION_NAME) + const link = createLinkElement(APPLICATION_NAME) contentDiv.appendChild(textNode) newDiv.appendChild(contentDiv) - // newDiv.appendChild(link) + newDiv.appendChild(link) insertIntoDOM(newDiv) // Measure the height after the element is inserted into the DOM const banner = document.getElementById('recovery-email-banner') @@ -29,8 +29,8 @@ document.addEventListener('DOMContentLoaded', function() { const intervalId = setInterval(() => { const contentVue = document.querySelector('#content-vue') if (contentVue) { - setMarginTopAndHeight('#content-vue', topHeight) - clearInterval(intervalId) + setMarginTopAndHeight('#content-vue', topHeight) + clearInterval(intervalId) } }, 100) } @@ -142,7 +142,6 @@ function createTextNode(appName) { if (unverifiedRecoveryEmail !== '') { labelText = t(appName, 'Please verify your recovery email address to fully enjoy your murena.io account.') } - labelText = '📢 ' + t(appName, "Murena Workspace will be back fully soon! Please read this guide to know more.") p.innerHTML = labelText setTimeout(() => { const link = p.querySelector('a') // Find the tag inside

@@ -153,6 +152,21 @@ function createTextNode(appName) { }, 10) return p } +/** + * + * @param appName + */ +function createLinkElement(appName) { + const link = document.createElement('a') + let labelText = t(appName, 'SET RECOVERY EMAIL NOW') + if (unverifiedRecoveryEmail !== '') { + labelText = t(appName, 'VERIFY RECOVERY EMAIL NOW') + } + link.textContent = labelText + link.href = OC.getRootPath() + '/settings/user/security#recovery-email-div' + link.style.display = 'block' + return link +} /** *