From c28e32a953ea753365065d85bc1b9fbdbaab8009 Mon Sep 17 00:00:00 2001
From: Julia Friesel <julia.friesel@gmail.com>
Date: Fri, 21 Dec 2018 15:40:46 +0100
Subject: [PATCH] Simplify stats constructor a bit

---
 components/stats.js | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/components/stats.js b/components/stats.js
index d192f04d..d9ec69c4 100644
--- a/components/stats.js
+++ b/components/stats.js
@@ -9,17 +9,14 @@ import cycleModule from '../lib/cycle'
 import {getCycleLengthStats as getCycleInfo} from '../lib/cycle-length'
 import {stats as labels} from '../i18n/en/labels'
 import AppText from './app-text'
-import { getCycleStartsSortedByDate } from '../db'
 
 export default class Stats extends Component {
   render() {
-    const allMensesStarts = getCycleStartsSortedByDate()
-    const atLeastOneCycle = allMensesStarts.length > 1
-    let cycleLengths
+    const cycleLengths = cycleModule().getAllCycleLengths()
+    const atLeastOneCycle = cycleLengths.length > 1
     let numberOfCycles
     let cycleInfo
     if (atLeastOneCycle) {
-      cycleLengths = cycleModule().getAllCycleLengths()
       numberOfCycles = cycleLengths.length
       if (numberOfCycles > 1) {
         cycleInfo = getCycleInfo(cycleLengths)
-- 
GitLab