commented logic for StatsBurn screen

mail@pastecode.io avatar
unknown
plain_text
a month ago
6.1 kB
1
Indexable
Never
// if (name == 'steps') {
                //     const valuesData = val?.data?.data?.steps?.chart?.day?.map(entry => entry.value)
                //     const titlesData = val?.data?.data?.steps?.chart?.day?.map(entry => moment(entry.title).format('MMM-DD'))
                //     const modifiedTitles = [titlesData[0]]
                //     for (let i = 1; i < titlesData.length; i++) {
                //         const day = parseInt(titlesData[i].split("-")[1]);
                //         modifiedTitles.push(day);
                //     }
                //     dispatch(storeCurrentTrackerData({
                //         titlesData: modifiedTitles,
                //         valuesData: valuesData,
                //         trackerType: selectedTracker,
                //         trackerData: val?.data?.data?.steps
                //     }))
                // } else if (name == 'weight') {
                //     const valuesData = val?.data?.data?.weight?.chart?.day?.map(entry => entry.value)
                //     const titlesData = val?.data?.data?.weight?.chart?.day?.map(entry => moment(entry.title).format('MMM-DD'))
                //     const modifiedTitles = [titlesData[0]]
                //     for (let i = 1; i < titlesData.length; i++) {
                //         const day = parseInt(titlesData[i].split("-")[1]);
                //         modifiedTitles.push(day);
                //     }
                //     dispatch(storeCurrentTrackerData({
                //         titlesData: modifiedTitles,
                //         valuesData: valuesData,
                //         trackerType: selectedTracker,
                //         trackerData: val?.data?.data?.weight
                //     }))
                // } else if (name == 'sleep') {
                //     const valuesData = val?.data?.data?.sleep?.chart?.day?.map(entry => entry.value)
                //     const titlesData = val?.data?.data?.sleep?.chart?.day?.map(entry => moment(entry.title).format('MMM-DD'))
                //     const modifiedTitles = [titlesData[0]]
                //     for (let i = 1; i < titlesData.length; i++) {
                //         const day = parseInt(titlesData[i].split("-")[1]);
                //         modifiedTitles.push(day);
                //     }
                //     dispatch(storeCurrentTrackerData({
                //         titlesData: modifiedTitles,
                //         valuesData: valuesData,
                //         trackerType: selectedTracker,
                //         trackerData: val?.data?.data?.sleep
                //     }))
                // } else if (name == 'burn') {
                //     const valuesData = val?.data?.data?.burn?.chart?.day?.map(entry => entry.value)
                //     const titlesData = val?.data?.data?.burn?.chart?.day?.map(entry => moment(entry.title).format('MMM-DD'))
                //     const modifiedTitles = [titlesData[0]]
                //     for (let i = 1; i < titlesData.length; i++) {
                //         const day = parseInt(titlesData[i].split("-")[1]);
                //         modifiedTitles.push(day);
                //     }
                //     dispatch(storeCurrentTrackerData({
                //         titlesData: modifiedTitles,
                //         valuesData: valuesData,
                //         trackerType: selectedTracker,
                //         trackerData: val?.data?.data?.burn
                //     }))
                // } else if (name == 'water') {
                //     const valuesData = val?.data?.data?.water?.chart?.day?.map(entry => entry.value)
                //     const titlesData = val?.data?.data?.water?.chart?.day?.map(entry => moment(entry.title).format('MMM-DD'))
                //     const modifiedTitles = [titlesData[0]]
                //     for (let i = 1; i < titlesData.length; i++) {
                //         const day = parseInt(titlesData[i].split("-")[1]);
                //         modifiedTitles.push(day);
                //     }
                //     dispatch(storeCurrentTrackerData({
                //         titlesData: modifiedTitles,
                //         valuesData: valuesData,
                //         trackerType: selectedTracker,
                //         trackerData: val?.data?.data?.water
                //     }))
                // } else if (name == 'heart') {
                //     const valuesData = val?.data?.data?.heart?.chart?.day?.map(entry => entry?.BPM)
                //     const titlesData = val?.data?.data?.heart?.chart?.day?.map(entry => moment(entry.title).format('MMM-DD'))
                //     const modifiedTitles = [titlesData[0]]
                //     for (let i = 1; i < titlesData.length; i++) {
                //         const day = parseInt(titlesData[i].split("-")[1]);
                //         modifiedTitles.push(day);
                //     }
                //     dispatch(storeCurrentTrackerData({
                //         titlesData: modifiedTitles,
                //         valuesData: valuesData,
                //         trackerType: selectedTracker,
                //         trackerData: val?.data?.data?.heart
                //     }))
                // } else if (name == 'bmi') {
                //     let paramsObj = {
                //         calc: 'bmi_calc'
                //     }
                //     getHealthIndicatorHistory(paramsObj).then(val => {
                //         const valuesData = val?.data?.data?.map(entry => entry.value)
                //         const titlesData = val?.data?.data?.map(entry => moment(entry.create_date).format('MMM-DD'))
                //         dispatch(storeCurrentTrackerData({
                //             titlesData: titlesData,
                //             valuesData: valuesData,
                //             trackerType: selectedTracker,
                //             trackerData: val?.data?.data
                //         }))
                //     }).catch(err => console.log(err?.response?.data))
                // }
Leave a Comment