diff --git a/packages/core/src/api/user-manager.ts b/packages/core/src/api/user-manager.ts index fa1ff8b2e..05057ef87 100644 --- a/packages/core/src/api/user-manager.ts +++ b/packages/core/src/api/user-manager.ts @@ -289,11 +289,12 @@ class UserManager { async setProfile(profile: Partial) { const user = await this.getUser(); const key = await this.getEncryptionKey(); + const userProfile = await this.getProfile(); if (!user || !key) return; user.profile = await this.db .storage() - .encrypt(key, JSON.stringify({ ...user.profile, ...profile })); + .encrypt(key, JSON.stringify({ ...userProfile, ...profile })); await this.updateUser(user); }