Skip to content

Commit dbf4703

Browse files
authored
Merge pull request #4314 from xhon-pelushi/fix/3853-tally-empty-state-to-settings
fix(tally): jump to settings when no tally types are configured
2 parents b2e265f + 6d79d31 commit dbf4703

4 files changed

Lines changed: 17 additions & 3 deletions

File tree

apps/tally/ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
0.01: New app!
22
0.02: Handle duplicate menu entries in the app
3+
0.03: Go straight to settings when no tally types are configured yet, instead of an empty list

apps/tally/app.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,10 @@ function tfmt(tally) {
103103
return "".concat(d.getHours(), ":").concat(pad2(d.getMinutes()));
104104
}
105105
var pad2 = function (s) { return ("0" + s.toFixed(0)).slice(-2); };
106-
showTallies(readTallies());
106+
var tallyCfg = storage.readJSON("tallycfg.json", 1) || [];
107+
if (tallyCfg.length === 0) {
108+
eval(storage.read("tally.settings.js"))(function () { return load(); });
109+
}
110+
else {
111+
showTallies(readTallies());
112+
}

apps/tally/app.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,11 @@ function tfmt(tally: Tally) {
123123

124124
const pad2 = (s: number) => ("0" + s.toFixed(0)).slice(-2);
125125

126-
showTallies(readTallies());
126+
const tallyCfg = storage.readJSON("tallycfg.json", 1) as TallySettings || [];
127+
if (tallyCfg.length === 0) {
128+
// No tally types configured yet, so there's nothing to log and nothing
129+
// to show here - go straight to settings so the user can add one.
130+
eval(storage.read("tally.settings.js") as string)(() => load());
131+
} else {
132+
showTallies(readTallies());
133+
}

apps/tally/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"id": "tally",
33
"name": "Tally Keeper",
44
"shortName": "Tally",
5-
"version": "0.02",
5+
"version": "0.03",
66
"author": "bobrippling",
77
"description": "Add to a tally from clock info",
88
"icon": "app.png",

0 commit comments

Comments
 (0)