diff --git a/core/route/account.js b/core/route/account.js index 687d45d..beefde6 100644 --- a/core/route/account.js +++ b/core/route/account.js @@ -95,11 +95,10 @@ function updateUser(profileId, userProfile) { console.log(`[ACC] User ${profileId} not found. Creating new user.`); decryptedData[profileId] = userProfile; // Create a new profile } else { + const currentUserData = decryptedData[profileId]; + Object.assign(currentUserData, userProfile) // Merge new data into the existing profile - decryptedData[profileId] = { - ...decryptedData[profileId], // Existing data - ...userProfile // New data to override specific fields - }; + decryptedData[profileId] = currentUserData } // Save the updated data