Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix: backup fails if user is not pro but encrypted backups is on (fixes streetwriters/notesnook#781)

thecodrrd35b2d42508a
diff --git a/packages/core/database/backup.js b/packages/core/database/backup.js
index 09be8b52a..49685b45b 100644
--- a/packages/core/database/backup.js
+++ b/packages/core/database/backup.js
@@ -29,7 +29,11 @@ export default class Backup {
* @param {boolean} encrypt
*/
async export(type, encrypt = false) {
- if (encrypt && !(await checkIsUserPremium(CHECK_IDS.backupEncrypt))) return;
+ if (encrypt && !(await checkIsUserPremium(CHECK_IDS.backupEncrypt))) {
+ throw new Error(
+ "Please upgrade your plan to Pro to use encrypted backups."
+ );
+ }
if (!validTypes.some((t) => t === type))
throw new Error("Invalid type. It must be one of 'mobile' or 'web'.");