mirror of https://github.com/espruino/BangleApps
fixes from PR comments
parent
5d2427dff2
commit
c3f3576200
|
@ -0,0 +1 @@
|
||||||
|
.prettierignore
|
|
@ -1,2 +1,2 @@
|
||||||
# Ignore icon:
|
# Ignore icon:
|
||||||
burn-icon.js
|
app-icon.js
|
|
@ -2,4 +2,5 @@
|
||||||
0.02: Added README.md
|
0.02: Added README.md
|
||||||
0.03: Icon update
|
0.03: Icon update
|
||||||
0.04: Icon Fix
|
0.04: Icon Fix
|
||||||
0.05: Misc cleanup for PR
|
0.05: Misc cleanup for PR
|
||||||
|
0.06: Implementing fixes from PR comments
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
@ -19,6 +19,9 @@
|
||||||
// File variable to handle file operations
|
// File variable to handle file operations
|
||||||
let file;
|
let file;
|
||||||
|
|
||||||
|
// Check if the hardware version is Bangle.js 2
|
||||||
|
const BANGLEJS2 = process.env.HWVERSION == 2;
|
||||||
|
|
||||||
// Importing the Storage module for file operations
|
// Importing the Storage module for file operations
|
||||||
const Storage = require("Storage");
|
const Storage = require("Storage");
|
||||||
|
|
||||||
|
@ -26,11 +29,11 @@ const Storage = require("Storage");
|
||||||
const PATH = "kcal.txt";
|
const PATH = "kcal.txt";
|
||||||
|
|
||||||
// Function to get the current date as a string
|
// Function to get the current date as a string
|
||||||
const dayString = () => {
|
function dayString() {
|
||||||
const date = new Date();
|
const date = new Date();
|
||||||
// Month is 0-indexed, so we add 1 to get the correct month number
|
// Month is 0-indexed, so we add 1 to get the correct month number
|
||||||
return `${date.getMonth() + 1}-${date.getDate()}-${date.getFullYear()}`;
|
return `${date.getMonth() + 1}-${date.getDate()}-${date.getFullYear()}`;
|
||||||
};
|
}
|
||||||
|
|
||||||
// Counter object to keep track of the count and the date
|
// Counter object to keep track of the count and the date
|
||||||
let counter = { count: 0, date: dayString() };
|
let counter = { count: 0, date: dayString() };
|
||||||
|
@ -135,23 +138,6 @@ const intervalFunctions = createIntervalFunctions();
|
||||||
const getInterval = intervalFunctions.getInterval;
|
const getInterval = intervalFunctions.getInterval;
|
||||||
const rotateIncrement = intervalFunctions.rotateIncrement;
|
const rotateIncrement = intervalFunctions.rotateIncrement;
|
||||||
|
|
||||||
// Check if the hardware version is Bangle.js 2
|
|
||||||
const BANGLEJS2 = process.env.HWVERSION == 2;
|
|
||||||
|
|
||||||
// Variables for drag handling and screen coordinates
|
|
||||||
let drag, y, x;
|
|
||||||
|
|
||||||
// If the hardware version is Bangle.js 2, set the coordinates accordingly
|
|
||||||
if (BANGLEJS2) {
|
|
||||||
drag = undefined;
|
|
||||||
y = 45;
|
|
||||||
x = 5;
|
|
||||||
} else {
|
|
||||||
// If the hardware version is Bangle.js 1, set the coordinates accordingly
|
|
||||||
y = 100;
|
|
||||||
x = 25;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Function to update the screen
|
// Function to update the screen
|
||||||
function updateScreen() {
|
function updateScreen() {
|
||||||
// Clear the screen area for the counter
|
// Clear the screen area for the counter
|
|
@ -1,16 +1,16 @@
|
||||||
{
|
{
|
||||||
"id": "burn",
|
"id": "burn",
|
||||||
"name": "Burn",
|
"name": "Burn",
|
||||||
"version": "0.05",
|
"version": "0.06",
|
||||||
"description": "Simple Calorie Counter -- saves to flash and resets at midnight. I often keep mine running while the digital clock widget is at the top",
|
"description": "Simple Calorie Counter -- saves to flash and resets at midnight. I often keep mine running while the digital clock widget is at the top",
|
||||||
"icon": "burn_icon.png",
|
"icon": "app-icon.png",
|
||||||
"tags": "tool",
|
"tags": "tool",
|
||||||
"readme":"README.md",
|
"readme":"README.md",
|
||||||
"supports": ["BANGLEJS", "BANGLEJS2"],
|
"supports": ["BANGLEJS", "BANGLEJS2"],
|
||||||
"screenshots": [{"url":"bangle1-burn-screenshot.png"}],
|
"screenshots": [{"url":"app-screenshot.png"}],
|
||||||
"allow_emulator": true,
|
"allow_emulator": true,
|
||||||
"storage": [
|
"storage": [
|
||||||
{"name":"burn.app.js","url":"burn.js"},
|
{"name":"burn.app.js","url":"app.js"},
|
||||||
{"name":"burn.img","url":"burn-icon.js","evaluate":true}
|
{"name":"burn.img","url":"app-icon.js","evaluate":true}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue