setInterval( () => { firebase.database().goOffline(); }, 20000, )
constructor(props) { super(props); this.notificationsRef = firebase.database().ref(`users/${this.props.userID}/notifications`); this.state = { playSound: false } }
const fetchPlaces = (regionId) => { return database.ref(apiUris.places) .orderByChild('regionId') .equalTo(parseInt(regionId)) .once('value') .then((snapshot) => { return snapshot.val() || []; }) }
changeVideoRef3(){ const videoRef = firebase.database().ref().child('react').child('videoID').child('vid3'); let givenURL = this.videoId3.value; let sendURL = this.parseYoutubeURL(givenURL); videoRef.set(sendURL); this.setState({ videoID: sendURL, }); }
const swapPositionUpDestination = (selected, selectedUp) => { const updatedObjects = {}; updatedObjects[selected.id + orderUri] = selectedUp.order; updatedObjects[selectedUp.id + orderUri] = selected.order; return database.ref(getActualUserUri()) .child('destinations') .update(updatedObjects); }
const saveUser = user => { return firebase.database().ref(`/users/${user.uid}`).update({ displayName: user.displayName || '', photoURL: user.photoURL || '', uid: user.uid, }); }
const startEditExpense = (id, updates) => { return (dispatch, getState) => { const uid = getState().auth.uid; return database.ref(`users/${uid}/expenses/${id}`).update(updates) .then(() => { dispatch(editExpense(id,updates)); }); }; }
const removeDestination = (destinationId) => { return database.ref(getActualUserUri()) .child('destinations/' + destinationId) .remove(); }
export function addComment(param) { return function (dispatch) { let path = "/Comments/" + param.title; firebase.database().ref(path).push(param.comment) } }
changeVideoBtn2(){ firebase.database().ref().child('react').child('videoID').child('vid2').once('value').then(snap =>{ this.setState({ videoID: snap.val() }); }) }
const deleteWish = (wishId, userId) => { let updates = {}; updates[`/wishes/${wishId}`] = null; updates[`/users/${userId}/wishes/${wishId}`] = null; return firebase.database().ref().update(updates); }
setInterval( () => { firebase.database().goOffline(); }, 20000, )
const upwish = (wishId, authorUid, uid) => { let updates = {}; updates[`/wishes/${wishId}/upwishes/${uid}`] = true; updates[`/users/${authorUid}/wishes/${wishId}/upwishes/${uid}`] = true; return firebase.database().ref().update(updates); }