Skip to content

Commit 61954c7

Browse files
author
Paulo Marcos
committed
feat: add currentDevice property to current device
1 parent ce90f54 commit 61954c7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/identities/identity/devices.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class Devices {
111111

112112
if (this.#devicesMap[currentId]) {
113113
this.#devicesMap[currentId] = merge(
114-
{ ...this.#devicesMap[currentId] },
114+
{ ...this.#devicesMap[currentId], current: true },
115115
pick(this.#currentDeviceDescriptor, DESCRIPTOR_SENSITIVE_KEYS),
116116
);
117117
}
@@ -174,7 +174,7 @@ export const createDevices = async (currentDevice, identityDescriptor, didm, sto
174174
await storage.set(getCurrentDeviceKey(identityDescriptor.id), currentDeviceDescriptor, { encrypt: true });
175175
await orbitdbStore.put(currentDeviceDescriptor.id, currentDeviceWithoutSensitiveKeys);
176176

177-
return new Devices(currentDevice, identityDescriptor, didm, orbitdbStore);
177+
return new Devices(currentDeviceDescriptor, identityDescriptor, didm, orbitdbStore);
178178
};
179179

180180
export const restoreDevices = async (identityDescriptor, didm, storage, orbitdb) => {

0 commit comments

Comments
 (0)