mirror of https://github.com/espruino/BangleApps
clkinfostopw: remove unused setting code
parent
c004336e3e
commit
69df7b35e5
|
@ -1,36 +0,0 @@
|
||||||
const enum StopWatchFormat {
|
|
||||||
HMS,
|
|
||||||
Colon,
|
|
||||||
}
|
|
||||||
type StopWatchSettings = {
|
|
||||||
format: StopWatchFormat,
|
|
||||||
};
|
|
||||||
|
|
||||||
(back => {
|
|
||||||
const SETTINGS_FILE = "clkinfostopw.setting.json";
|
|
||||||
|
|
||||||
const storage = require("Storage");
|
|
||||||
const settings: StopWatchSettings = Object.assign(
|
|
||||||
{ format: StopWatchFormat.HMS },
|
|
||||||
storage.readJSON(SETTINGS_FILE, true),
|
|
||||||
);
|
|
||||||
|
|
||||||
const save = () => {
|
|
||||||
storage.writeJSON(SETTINGS_FILE, settings)
|
|
||||||
};
|
|
||||||
|
|
||||||
E.showMenu({
|
|
||||||
"": { "title": "stopwatch" },
|
|
||||||
"< Back": back,
|
|
||||||
"Format": {
|
|
||||||
value: settings.format,
|
|
||||||
min: StopWatchFormat.HMS,
|
|
||||||
max: StopWatchFormat.Colon,
|
|
||||||
format: v => v === StopWatchFormat.HMS ? "12m34s" : "12:34",
|
|
||||||
onchange: v => {
|
|
||||||
settings.format = v;
|
|
||||||
save();
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}) satisfies SettingsFunc
|
|
Loading…
Reference in New Issue