From 108e0650a194de32713f9fa5fd9b69c5cd520723 Mon Sep 17 00:00:00 2001 From: Karl Date: Tue, 26 Nov 2024 12:03:37 +0100 Subject: [PATCH] fix cloud storage initialization --- .../js-sdk/src/storage/EncryptedCloudStorage.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/packages/js-sdk/src/storage/EncryptedCloudStorage.ts b/packages/js-sdk/src/storage/EncryptedCloudStorage.ts index 6300e2eb4..586dc638d 100644 --- a/packages/js-sdk/src/storage/EncryptedCloudStorage.ts +++ b/packages/js-sdk/src/storage/EncryptedCloudStorage.ts @@ -28,9 +28,6 @@ export class EncryptedCloudStorage { } private async encryptSync(data: string) { - console.log('this.account', this.account); - console.log('this.account.ensName', this.account.ensName); - const accountNonce = sha256(this.account.ensName).slice(0, 26); const encryptedPayload: EncryptedPayload = await _encrypt( this.profileKeys?.encryptionKeyPair?.privateKey!, @@ -70,11 +67,11 @@ export class EncryptedCloudStorage { } public getCloudStorage() { - return getCloudStorage(this.backendConnector, this.account.ensName, { - encryptAsync: this.encryptAsync, - decryptAsync: this.decryptAsync, - encryptSync: this.encryptSync, - decryptSync: this.decryptSync, + return getCloudStorage(this.backendConnector, this.account!.ensName, { + encryptAsync: this.encryptAsync.bind(this), + decryptAsync: this.decryptAsync.bind(this), + encryptSync: this.encryptSync.bind(this), + decryptSync: this.decryptSync.bind(this), }); } }