@@ -111,7 +111,7 @@ class Devices {
111
111
112
112
if ( this . #devicesMap[ currentId ] ) {
113
113
this . #devicesMap[ currentId ] = merge (
114
- { ...this . #devicesMap[ currentId ] } ,
114
+ { ...this . #devicesMap[ currentId ] , current : true } ,
115
115
pick ( this . #currentDeviceDescriptor, DESCRIPTOR_SENSITIVE_KEYS ) ,
116
116
) ;
117
117
}
@@ -174,11 +174,11 @@ export const createDevices = async (currentDevice, identityDescriptor, didm, sto
174
174
await storage . set ( getCurrentDeviceKey ( identityDescriptor . id ) , currentDeviceDescriptor , { encrypt : true } ) ;
175
175
await orbitdbStore . put ( currentDeviceDescriptor . id , currentDeviceWithoutSensitiveKeys ) ;
176
176
177
- return new Devices ( currentDevice , identityDescriptor , didm , orbitdbStore ) ;
177
+ return new Devices ( currentDeviceDescriptor , identityDescriptor , didm , orbitdbStore ) ;
178
178
} ;
179
179
180
180
export const restoreDevices = async ( identityDescriptor , didm , storage , orbitdb ) => {
181
- const currentDeviceDescriptor = await storage . get ( getCurrentDeviceKey ( identityDescriptor . id ) ) ;
181
+ const currentDeviceDescriptor = await storage . get ( identityDescriptor . id ) ;
182
182
const orbitdbStore = await loadStore ( orbitdb , ORBITDB_STORE_NAME , ORBITDB_STORE_TYPE ) ;
183
183
184
184
return new Devices ( currentDeviceDescriptor , identityDescriptor , didm , orbitdbStore ) ;
0 commit comments