Skip to content

Commit

Permalink
rep: check settings
Browse files Browse the repository at this point in the history
  • Loading branch information
bobrippling committed Jul 1, 2023
1 parent 4fe1043 commit a0747b4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion apps/rep/app.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
var _a, _b, _c;
{
var L = require("Layout");
var storeReps = require("Storage")
Expand All @@ -14,7 +15,10 @@
: r.dur;
return r2;
});
var settings = require("Storage").readJSON("rep.setting.json");
var settings = (require("Storage").readJSON("rep.setting.json", true) || {});
(_a = settings.record) !== null && _a !== void 0 ? _a : (settings.record = false);
(_b = settings.recordStopOnExit) !== null && _b !== void 0 ? _b : (settings.recordStopOnExit = false);
(_c = settings.stepMs) !== null && _c !== void 0 ? _c : (settings.stepMs = 5 * 1000);
var fontSzMain = 54;
var fontScaleRep = 2;
var fontSzRep = 20;
Expand Down
6 changes: 5 additions & 1 deletion apps/rep/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ const reps = storeReps.map((r: StoreRep, i: number, a: Rep[]): Rep => {
return r2;
});

const settings = require("Storage").readJSON("rep.setting.json") as RepSettings;
const settings = (require("Storage").readJSON("rep.setting.json", true) || {}) as RepSettings;
settings.record ??= false;
settings.recordStopOnExit ??= false;
settings.stepMs ??= 5 * 1000;

const fontSzMain = 54;
const fontScaleRep = 2;
const fontSzRep = 20;
Expand Down

0 comments on commit a0747b4

Please sign in to comment.