rn-photo-picker
Advanced tools
Comparing version 0.0.3 to 0.0.4
10
index.js
@@ -20,4 +20,5 @@ import React, { PureComponent } from "react"; | ||
const assets = data.edges; | ||
const images = assets.map(asset => asset.node); | ||
if (images.length < 1) { | ||
if (images.length === 0) { | ||
this.props.onEmpty(); | ||
@@ -27,2 +28,3 @@ } | ||
} catch (e) { | ||
this.props.onEmpty(); | ||
console.warn(e); | ||
@@ -56,3 +58,3 @@ } | ||
state = { images: [], picked: [], image: {} }; | ||
state = { images: null, picked: [], image: {} }; | ||
@@ -77,7 +79,5 @@ changeOption(prevState, item) { | ||
const margin = this.props.margin / 2; | ||
if (this.state.images.length < 1) { | ||
if (this.state.images === null || this.state.images.length === 0) { | ||
return null; | ||
} | ||
return ( | ||
@@ -84,0 +84,0 @@ <FlatList |
{ | ||
"name": "rn-photo-picker", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "private": false, |
311886
122