File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
frameworks/keyed/react-native-onyx/src Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -128,11 +128,13 @@ function select(item) {
128
128
}
129
129
function swapRows ( ) {
130
130
const array = Object . values ( object ) ;
131
- const firstRow = array [ 1 ] ;
132
- const lastRow = array [ 998 ] ;
131
+ const firstRow = { ... array [ 1 ] } ;
132
+ const lastRow = { ... array [ 998 ] } ;
133
133
134
- Onyx . set ( `${ ONYXKEYS . COLLECTION . OBJECT } ${ firstRow . id === 2 ? firstRow . id : lastRow . id } ` , lastRow ) ;
135
- Onyx . set ( `${ ONYXKEYS . COLLECTION . OBJECT } ${ lastRow . id === 999 ? lastRow . id : firstRow . id } ` , firstRow ) ;
134
+ Onyx . mergeCollection ( ONYXKEYS . COLLECTION . OBJECT , {
135
+ [ `${ ONYXKEYS . COLLECTION . OBJECT } ${ firstRow . id === 2 ? firstRow . id : lastRow . id } ` ] : lastRow ,
136
+ [ `${ ONYXKEYS . COLLECTION . OBJECT } ${ lastRow . id === 999 ? lastRow . id : firstRow . id } ` ] : firstRow ,
137
+ } ) ;
136
138
}
137
139
function clear ( ) {
138
140
Onyx . clear ( ) ;
You can’t perform that action at this time.
0 commit comments