File tree 1 file changed +6
-8
lines changed
packages/ra-core/src/store
1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -116,15 +116,13 @@ export const localStorageStore = (
116
116
} ,
117
117
reset ( ) : void {
118
118
const storage = getStorage ( ) ;
119
- for ( let i = 0 ; i < storage . length ; i ++ ) {
120
- if ( storage . key ( i ) ?. substring ( 0 , prefixLength ) === prefix ) {
121
- const key = storage . key ( i ) ?. substring ( prefixLength + 1 ) ;
122
- if ( ! key || ! storage . key ( i ) ) return ;
123
- // @ts -ignore
124
- storage . removeItem ( storage . key ( i ) ) ;
125
- publish ( key , undefined ) ;
119
+ Object . keys ( storage ) . forEach ( key => {
120
+ if ( key . startsWith ( prefix ) ) {
121
+ storage . removeItem ( key ) ;
122
+ const publishKey = key . substring ( prefixLength + 1 ) ;
123
+ publish ( publishKey , undefined ) ;
126
124
}
127
- }
125
+ } ) ;
128
126
} ,
129
127
subscribe : ( key : string , callback : ( value : string ) => void ) => {
130
128
const id = Math . random ( ) . toString ( ) ;
You can’t perform that action at this time.
0 commit comments