Skip to content

Commit da02707

Browse files
committed
Bug corrections
- Corrected variable name that was causing issues with the json file - Added a warning to prevent errors when trying to load graph when there's less than three records saved
1 parent 1e30fb2 commit da02707

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

heftlog.zip

3.81 KB
Binary file not shown.

src/.gitignore

Whitespace-only changes.

src/heftlog.app.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ function logWeight(W, profile){
7474
}
7575

7676
//TODO: Prompt the user to confirm in case of overwritting
77-
S.writeJSON(FILE, t);
77+
S.writeJSON(FILE, profile);
7878
return true;
7979
}
8080

@@ -105,9 +105,16 @@ function showLog(L){
105105
function loadGraph(L, height){
106106
E.showMenu();
107107

108+
// Warns the user in case of insufficient data
109+
if (L.length < 3){
110+
E.showAlert('Insufficient data for Graph')
111+
.then(() => start() );
112+
return;
113+
}
114+
108115
// Calculate the interval between the first and the last entry
109116
let span = L[0].ts - L[L.length-1].ts;
110-
117+
111118
// Placeholders for the minimum and maximum weight values
112119
let bottom = L[0].heft, top = bottom;
113120

@@ -191,4 +198,4 @@ if (Profile.height != null) {
191198
},
192199
'Change height' : HeightMenu,
193200
});
194-
}
201+
}

0 commit comments

Comments
 (0)