diff --git a/apps/settings/src/components/Encryption.vue b/apps/settings/src/components/Encryption.vue index 4d80f9b98338e..6aabc7ba51c52 100644 --- a/apps/settings/src/components/Encryption.vue +++ b/apps/settings/src/components/Encryption.vue @@ -14,6 +14,10 @@ {{ t('settings', 'Enable server-side encryption') }} +
{{ t('settings', 'Encryption is not ready. Please enable an encryption module or app.') }}
+{{ t('settings', 'Please read carefully before activating server-side encryption:') }}
+
{{ t('settings', 'No encryption module loaded, please enable an encryption module in the app menu.') }}
@@ -89,15 +93,26 @@ export default { }, data() { const encryptionModules = loadState('settings', 'encryption-modules') + const hasEncryptionModules = encryptionModules instanceof Array && encryptionModules.length > 0 + let defaultCheckedModule = '' + if (hasEncryptionModules) { + const defaultModule = Object.entries(encryptionModules).find((module) => module[1].default) + if (defaultModule) { + defaultCheckedModule = foundModule[0] + } + } else { + logger.debug('No encryption module loaded or enabled') + } return { - encryptionReady: loadState('settings', 'encryption-ready'), - encryptionEnabled: loadState('settings', 'encryption-enabled'), + encryptionReady: loadState('settings', 'encryption-ready', false), + encryptionEnabled: loadState('settings', 'encryption-enabled', false), externalBackendsEnabled: loadState('settings', 'external-backends-enabled'), encryptionAdminDoc: loadState('settings', 'encryption-admin-doc'), encryptionModules, shouldDisplayWarning: false, migrating: false, - defaultCheckedModule: Object.entries(encryptionModules).find((module) => module[1].default)[0], + defaultCheckedModule, + hasEncryptionModules, } }, methods: {