@@ -228,8 +228,8 @@ export class LocalStorageCryptoStore extends MemoryCryptoStore {
228228 // (hence 43 characters long).
229229
230230 func ( {
231- senderKey : key . substr ( KEY_INBOUND_SESSION_PREFIX . length , 43 ) ,
232- sessionId : key . substr ( KEY_INBOUND_SESSION_PREFIX . length + 44 ) ,
231+ senderKey : key . slice ( KEY_INBOUND_SESSION_PREFIX . length , KEY_INBOUND_SESSION_PREFIX . length + 43 ) ,
232+ sessionId : key . slice ( KEY_INBOUND_SESSION_PREFIX . length + 44 ) ,
233233 sessionData : getJsonItem ( this . store , key ) ,
234234 } ) ;
235235 }
@@ -299,7 +299,7 @@ export class LocalStorageCryptoStore extends MemoryCryptoStore {
299299 for ( let i = 0 ; i < this . store . length ; ++ i ) {
300300 const key = this . store . key ( i ) ;
301301 if ( key . startsWith ( prefix ) ) {
302- const roomId = key . substr ( prefix . length ) ;
302+ const roomId = key . slice ( prefix . length ) ;
303303 result [ roomId ] = getJsonItem ( this . store , key ) ;
304304 }
305305 }
@@ -313,8 +313,8 @@ export class LocalStorageCryptoStore extends MemoryCryptoStore {
313313 for ( const session in sessionsNeedingBackup ) {
314314 if ( Object . prototype . hasOwnProperty . call ( sessionsNeedingBackup , session ) ) {
315315 // see getAllEndToEndInboundGroupSessions for the magic number explanations
316- const senderKey = session . substr ( 0 , 43 ) ;
317- const sessionId = session . substr ( 44 ) ;
316+ const senderKey = session . slice ( 0 , 43 ) ;
317+ const sessionId = session . slice ( 44 ) ;
318318 this . getEndToEndInboundGroupSession (
319319 senderKey , sessionId , null ,
320320 ( sessionData ) => {
0 commit comments