Menu and typo fixes
parent
525980d7f7
commit
2edad3887f
|
|
@ -44,6 +44,7 @@ var exs = ExStats.getStats(statIDs, settings);
|
|||
// Called to start/stop running
|
||||
function onStartStop() {
|
||||
var running = !exs.state.active;
|
||||
var prepPromises = [];
|
||||
|
||||
// start/stop recording
|
||||
// Do this first in case recorder needs to prompt for
|
||||
|
|
@ -51,16 +52,22 @@ function onStartStop() {
|
|||
if (settings.record && WIDGETS["recorder"]) {
|
||||
if (running) {
|
||||
isMenuDisplayed = true;
|
||||
prepPromises.push(
|
||||
WIDGETS["recorder"].setRecording(true).then(() => {
|
||||
isMenuDisplayed = false;
|
||||
layout.forgetLazyState();
|
||||
layout.render();
|
||||
});
|
||||
})
|
||||
);
|
||||
} else {
|
||||
WIDGETS["recorder"].setRecording(false);
|
||||
prepPromises.push(
|
||||
WIDGETS["recorder"].setRecording(false)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Promise.all(prepPromises)
|
||||
.then(() => {
|
||||
if (running) {
|
||||
exs.start();
|
||||
} else {
|
||||
|
|
@ -72,6 +79,7 @@ function onStartStop() {
|
|||
// if stopping running, don't clear state
|
||||
// so we can at least refer to what we've done
|
||||
layout.render();
|
||||
});
|
||||
}
|
||||
|
||||
var lc = [];
|
||||
|
|
@ -104,7 +112,8 @@ layout.render();
|
|||
|
||||
function configureNotification(stat) {
|
||||
stat.on('notify', (e)=>{
|
||||
console.log(`Got notify from ${e}`);
|
||||
console.log(`Got notify from ${JSON.stringify(e)}`);
|
||||
console.log(JSON.stringify(settings.notify[e.id]));
|
||||
settings.notify[e.id].notifications.reduce(function (promise, buzzPattern) {
|
||||
console.log(buzzPattern);
|
||||
return promise.then(function () {
|
||||
|
|
|
|||
|
|
@ -81,31 +81,31 @@
|
|||
[[300, 1],[200, 0],[300, 1],[200, 0],[300, 1]],
|
||||
];
|
||||
menu[/*LANG*/"Dist Ntfy Ptrn"] = {
|
||||
value: Math.max(0,vibPatterns.indexOf(settings.notify.dist.notification)),
|
||||
value: Math.max(0,vibPatterns.indexOf(settings.notify.dist.notifications)),
|
||||
min: 0, max: vibPatterns.length,
|
||||
format: v => vibPatterns[v]||"Off",
|
||||
onchange: v => {
|
||||
settings.notify.dist.notification = vibTimes[v];
|
||||
settings.notify.dist.notifications = vibTimes[v];
|
||||
sampleBuzz(vibTimes[v]);
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
menu[/*LANG*/"Step Ntfy Ptrn"] = {
|
||||
value: Math.max(0,vibPatterns.indexOf(settings.notify.step.notification)),
|
||||
value: Math.max(0,vibPatterns.indexOf(settings.notify.step.notifications)),
|
||||
min: 0, max: vibPatterns.length,
|
||||
format: v => vibPatterns[v]||"Off",
|
||||
onchange: v => {
|
||||
settings.notify.step.notification = vibTimes[v];
|
||||
settings.notify.step.notifications = vibTimes[v];
|
||||
sampleBuzz(vibTimes[v]);
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
menu[/*LANG*/"Time Ntfy Ptrn"] = {
|
||||
value: Math.max(0,vibPatterns.indexOf(settings.notify.time.notification)),
|
||||
value: Math.max(0,vibPatterns.indexOf(settings.notify.time.notifications)),
|
||||
min: 0, max: vibPatterns.length,
|
||||
format: v => vibPatterns[v]||"Off",
|
||||
onchange: v => {
|
||||
settings.notify.time.notification = vibTimes[v];
|
||||
settings.notify.time.notifications = vibTimes[v];
|
||||
sampleBuzz(vibTimes[v]);
|
||||
saveSettings();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue