1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-16 00:14:34 +02:00

All: Improved E2EE usability by making its state a property of the sync target (#5276)

This commit is contained in:
Laurent
2021-08-12 16:54:10 +01:00
committed by GitHub
parent ba3cbfa051
commit dcd5a8d975
102 changed files with 1775 additions and 551 deletions

View File

@ -13,6 +13,7 @@ const { filename, safeFilename } = require('../path-utils');
const { FsDriverDummy } = require('../fs-driver-dummy.js');
import JoplinError from '../JoplinError';
import itemCanBeEncrypted from './utils/itemCanBeEncrypted';
import { getEncryptionEnabled } from '../services/synchronizer/syncInfoUtils';
export default class Resource extends BaseItem {
@ -196,7 +197,7 @@ export default class Resource extends BaseItem {
public static async fullPathForSyncUpload(resource: ResourceEntity) {
const plainTextPath = this.fullPath(resource);
if (!Setting.value('encryption.enabled') || !itemCanBeEncrypted(resource as any)) {
if (!getEncryptionEnabled() || !itemCanBeEncrypted(resource as any)) {
// Normally not possible since itemsThatNeedSync should only return decrypted items
if (resource.encryption_blob_encrypted) throw new Error('Trying to access encrypted resource but encryption is currently disabled');
return { path: plainTextPath, resource: resource };