(mindHabit, moneyHabit, bodyHabit, funHabit)
| 124 | }; |
| 125 | |
| 126 | const checkStatus = (mindHabit, moneyHabit, bodyHabit, funHabit) => { |
| 127 | const date = new Date(); |
| 128 | |
| 129 | const mindLastCheck = date - new Date(mindHabit?.lastCheck); |
| 130 | |
| 131 | const mindDiff = parseInt(mindLastCheck / (1000 * 3600 * 24)); |
| 132 | |
| 133 | // Verificação da mente |
| 134 | if (mindHabit?.habitFrequency === "Diário") { |
| 135 | if (mindDiff === 1) { |
| 136 | HabitsService.changeProgress({ |
| 137 | progressBar: 0.5, |
| 138 | habitArea: mindHabit?.habitArea, |
| 139 | }); |
| 140 | } else if (mindDiff === 2) { |
| 141 | HabitsService.changeProgress({ |
| 142 | progressBar: 0.25, |
| 143 | habitArea: mindHabit?.habitArea, |
| 144 | }); |
| 145 | } else if (mindDiff >= 3) { |
| 146 | HabitsService.changeProgress({ |
| 147 | progressBar: 0, |
| 148 | habitArea: mindHabit?.habitArea, |
| 149 | }); |
| 150 | } |
| 151 | } |
| 152 | if (mindHabit?.habitFrequency === "Semanal") { |
| 153 | if (mindDiff === 8) { |
| 154 | HabitsService.changeProgress({ |
| 155 | progressBar: 0.5, |
| 156 | habitArea: mindHabit?.habitArea, |
| 157 | }); |
| 158 | } else if (mindDiff === 9) { |
| 159 | HabitsService.changeProgress({ |
| 160 | progressBar: 0.25, |
| 161 | habitArea: mindHabit?.habitArea, |
| 162 | }); |
| 163 | } else if (mindDiff >= 10) { |
| 164 | HabitsService.changeProgress({ |
| 165 | progressBar: 0, |
| 166 | habitArea: mindHabit?.habitArea, |
| 167 | }); |
| 168 | } |
| 169 | } |
| 170 | if (mindHabit?.habitFrequency === "Mensal") { |
| 171 | if (mindDiff === 31) { |
| 172 | HabitsService.changeProgress({ |
| 173 | progressBar: 0.5, |
| 174 | habitArea: mindHabit?.habitArea, |
| 175 | }); |
| 176 | } else if (mindDiff === 32) { |
| 177 | HabitsService.changeProgress({ |
| 178 | progressBar: 0.25, |
| 179 | habitArea: mindHabit?.habitArea, |
| 180 | }); |
| 181 | } else if (mindDiff >= 33) { |
| 182 | HabitsService.changeProgress({ |
| 183 | progressBar: 0, |
nothing calls this directly
no outgoing calls
no test coverage detected