mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-09-01 19:49:54 +02:00
core: fetch user profile before updating profile
This commit is contained in:
committed by
Abdullah Atta
parent
54ba654b97
commit
85c50bf0fa
@@ -289,11 +289,12 @@ class UserManager {
|
||||
async setProfile(profile: Partial<Profile>) {
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user