mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 06:59:31 +01:00
fix: backup fails if user is not pro but encrypted backups is on
(fixes streetwriters/notesnook#781)
This commit is contained in:
@@ -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'.");
|
||||
|
||||
Reference in New Issue
Block a user