fix: use wrapper merge when returning the display name in memory

pull/3056/head
William Grant 1 year ago
parent 038589114f
commit c5c06af772

@ -419,17 +419,13 @@ export class SwarmPolling {
const privateKeyEd25519 = keypair.privKeyBytes;
// we take the lastest config message to create the wrapper in memory
const incomingConfigMessage = allDecryptedConfigMessages.at(-1);
if (!incomingConfigMessage) {
throw new Error('incomingConfigMessage not found');
}
const incomingConfigMessages = allDecryptedConfigMessages.map(m => ({
data: m.message.data,
hash: m.messageHash,
}));
await GenericWrapperActions.init('UserConfig', privateKeyEd25519, null);
await GenericWrapperActions.merge('UserConfig', [
{
data: incomingConfigMessage.message.data,
hash: incomingConfigMessage.messageHash,
},
]);
await GenericWrapperActions.merge('UserConfig', incomingConfigMessages);
const userInfo = await UserConfigWrapperActions.getUserInfo();
if (!userInfo) {

Loading…
Cancel
Save