sleeplog - Fix translation messing with back menu items

pull/3367/head
Martin Boonk 2024-04-20 08:31:41 +02:00
parent 14b6257bd7
commit ed42b0eb41
3 changed files with 13 additions and 12 deletions

View File

@ -13,3 +13,4 @@
0.15: Issue newline before GB commands (solves issue with console.log and ignored commands) 0.15: Issue newline before GB commands (solves issue with console.log and ignored commands)
0.16: Only write logs if we have a non-empty log to write 0.16: Only write logs if we have a non-empty log to write
0.17: Minor code improvements 0.17: Minor code improvements
0.18: Add back as a function to prevent translation making it a menu entry

View File

@ -2,7 +2,7 @@
"id":"sleeplog", "id":"sleeplog",
"name":"Sleep Log", "name":"Sleep Log",
"shortName": "SleepLog", "shortName": "SleepLog",
"version": "0.17", "version": "0.18",
"description": "Log and view your sleeping habits. This app is using the built in movement calculation.", "description": "Log and view your sleeping habits. This app is using the built in movement calculation.",
"icon": "app.png", "icon": "app.png",
"type": "app", "type": "app",

View File

@ -246,14 +246,14 @@
// setup debugging menu // setup debugging menu
var debugMenu = { var debugMenu = {
"": { "": {
title: /*LANG*/"Debugging" title: /*LANG*/"Debugging",
}, back: () => {
/*LANG*/"< Back": () => { // check if some value has changed
// check if some value has changed if (enabled !== !!global.sleeplog.debug || file !== (typeof global.sleeplog.debug === "object") || duration)
if (enabled !== !!global.sleeplog.debug || file !== (typeof global.sleeplog.debug === "object") || duration) require("sleeplog").setDebug(enabled, file ? duration || 12 : undefined);
require("sleeplog").setDebug(enabled, file ? duration || 12 : undefined); // redraw main menu
// redraw main menu showMain(7);
showMain(7); }
}, },
/*LANG*/"View log": () => selectDebug(), /*LANG*/"View log": () => selectDebug(),
/*LANG*/"Enable": { /*LANG*/"Enable": {
@ -293,9 +293,9 @@
//var menu; //var menu;
var thresholdsMenu = { var thresholdsMenu = {
"": { "": {
title: /*LANG*/"Thresholds" title: /*LANG*/"Thresholds",
back: () => showMain(2)
}, },
/*LANG*/"< Back": () => showMain(2),
/*LANG*/"Max Awake": { /*LANG*/"Max Awake": {
value: settings.maxAwake / 6E4, value: settings.maxAwake / 6E4,
step: 10, step: 10,
@ -398,9 +398,9 @@
var mainMenu = { var mainMenu = {
"": { "": {
title: "Sleep Log", title: "Sleep Log",
back: back,
selected: selected selected: selected
}, },
/*LANG*/"< Back": () => back(),
/*LANG*/"Thresholds": () => showThresholds(), /*LANG*/"Thresholds": () => showThresholds(),
/*LANG*/"Break ToD": { /*LANG*/"Break ToD": {
value: settings.breakToD, value: settings.breakToD,