@@ -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,11 +174,11 @@ 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
180180export const restoreDevices = async ( identityDescriptor , didm , storage , orbitdb ) => {
181- const currentDeviceDescriptor = await storage . get ( getCurrentDeviceKey ( identityDescriptor . id ) ) ;
181+ const currentDeviceDescriptor = await storage . get ( identityDescriptor . id ) ;
182182 const orbitdbStore = await loadStore ( orbitdb , ORBITDB_STORE_NAME , ORBITDB_STORE_TYPE ) ;
183183
184184 return new Devices ( currentDeviceDescriptor , identityDescriptor , didm , orbitdbStore ) ;
0 commit comments