Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions index.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ class FirebaseReactNativeSample extends Component {
{
text: 'Add',
onPress: (text) => {
this.itemsRef.push({ title: text })
if (text) { this.itemsRef.push({ title: text }) } /** Will push only if text is not empty */
else { console.log("Text Input empty") }
}
},
],
Expand All @@ -109,7 +110,7 @@ class FirebaseReactNativeSample extends Component {

const onPress = () => {
AlertIOS.alert(
'Complete',
'Completed ' + item.title + ' ?' , /** Just a small edit to confirm the item name */
null,
[
{text: 'Complete', onPress: (text) => this.itemsRef.child(item._key).remove()},
Expand Down