diff options
author | Arseniy Movshev <dodoradio@outlook.com> | 2023-05-30 11:35:13 +0100 |
---|---|---|
committer | Arseniy Movshev <dodoradio@outlook.com> | 2023-05-30 11:35:13 +0100 |
commit | 4b989d322c598ed0a807e0e2179a071bc823894f (patch) | |
tree | c3f6b0e541f11366114f136bdcdea92be9619ad5 /src | |
parent | 3f90ac48e13468ffd480eade851432d5a63a7353 (diff) |
Make steps graph trigger a recording when the app starts
This should mean we always have the most up-to-date data.
I am not sure this will work - the daemon may still be taking the reading as the graph draws, so the data still isn't fresh. Frankly, the daemon's recording mechanism needs a rewrite, and this is a stopgap.
Diffstat (limited to 'src')
-rw-r--r-- | src/main.qml | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/main.qml b/src/main.qml index af4dd13..bcf12d8 100644 --- a/src/main.qml +++ b/src/main.qml @@ -27,11 +27,6 @@ Application { centerColor: "#b04d1c" outerColor: "#421c0a" - StepsDataLoader { - id: stepsDataLoader - // Component.onCompleted: stepsLabel.text = getTodayData() - } - property var weekday: ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]; @@ -75,7 +70,14 @@ Application { property var maxValue: 0 property var divisionsInterval: 0 property var divisionsCount: 0 - Component.onCompleted: { + StepsDataLoader { + id: stepsDataLoader + Component.onCompleted: { + triggerDaemonRecording() + stepsGraph.loadData() + } + } + function loadData() { var currDate = new Date() currDate.setDate(currDate.getDate() - 7) for (var i = 0; i < 7; i++) { |