File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ class CameraRollPicker extends Component {
118
118
< Image
119
119
source = { { uri : item . node . image . uri } }
120
120
style = { { height : this . _imageSize , width : this . _imageSize } } >
121
- { ( this . state . selected . indexOf ( item . node . image ) >= 0 ) ? marker : null }
121
+ { ( this . _arrayObjectIndexOf ( this . state . selected , 'uri' , item . node . image . uri ) >= 0 ) ? marker : null }
122
122
</ Image >
123
123
</ TouchableOpacity >
124
124
) ;
@@ -156,7 +156,7 @@ class CameraRollPicker extends Component {
156
156
var { maximum, imagesPerRow, callback} = this . props ;
157
157
158
158
var selected = this . state . selected ,
159
- index = selected . indexOf ( image ) ;
159
+ index = this . _arrayObjectIndexOf ( selected , 'uri' , image . uri ) ;
160
160
161
161
if ( index >= 0 ) {
162
162
selected . splice ( index , 1 ) ;
@@ -198,6 +198,10 @@ class CameraRollPicker extends Component {
198
198
return result ;
199
199
}
200
200
201
+ _arrayObjectIndexOf ( array , property , value ) {
202
+ return array . map ( ( o ) => { return o [ property ] ; } ) . indexOf ( value ) ;
203
+ }
204
+
201
205
}
202
206
203
207
const styles = StyleSheet . create ( {
You can’t perform that action at this time.
0 commit comments