
import {
SHOW_POMODARIO,
HIDE_POMODARIO,
TOGLE_POMODARIO,
CHANGE_REF_KEY
} from "./action-types"



//const pomodarioRef = new Firebase(C.FIREBASE).child('pomodarios'); 
const pomodarioActions = {

  setPomodarioDone(qid, article){
    return (dispatch, getState) => {
      const { /*auth,*/ firebase } = getState();
      var pomodarioRef = firebase.pomodario
      console.log(qid)
      if (qid.refkey != null){
        pomodarioRef.push({qid, date: (new Date()).getTime()})
      }
    }
  },

  toglePomodarioOff(qid, article){
    return (dispatch) => {
      //pomodarioRef.push({article})
      dispatch({type: HIDE_POMODARIO})
    }
  },

  changePomodarioKey(qid){
    return (dispatch) => {
      dispatch({type: CHANGE_REF_KEY, data: qid})
    }
  },

  toglePomodario(qid, article){
    return (dispatch) => {
      //pomodarioRef.push({article})
      dispatch({type: TOGLE_POMODARIO})
      dispatch({type: CHANGE_REF_KEY, data: qid})
    }
  },


}

export default pomodarioActions;

@@ -280,18 +280,18 @@
 st %7B
- /*auth,*/
+pomodario,
  fir
@@ -355,16 +355,36 @@
 omodario
+.child(%22pomodarios%22)
 %0A      c
@@ -394,16 +394,34 @@
 ole.log(
+%22pomodarioRef: %22, 
 qid)%0A   
@@ -427,19 +427,25 @@
     if (
-qid
+pomodario
 .refkey 
@@ -454,16 +454,61 @@
  null)%7B%0A
+        console.log(%22push to server: %22, qid)%0A
         

fix push to server