choozi - Only write if actually changed
parent
6539dc48b1
commit
6204206df3
|
|
@ -146,14 +146,19 @@ function setN(n) {
|
||||||
|
|
||||||
// save N to choozi.save
|
// save N to choozi.save
|
||||||
function writeN() {
|
function writeN() {
|
||||||
require("Storage").write("choozi.save","" + N);
|
var savedN = read();
|
||||||
|
if (savedN != N) require("Storage").write("choozi.save","" + N);
|
||||||
|
}
|
||||||
|
|
||||||
|
function read(){
|
||||||
|
var n = require("Storage").read("choozi.save");
|
||||||
|
if (n !== undefined) return parseInt(n);
|
||||||
|
return defaultN;
|
||||||
}
|
}
|
||||||
|
|
||||||
// load N from choozi.save
|
// load N from choozi.save
|
||||||
function readN() {
|
function readN() {
|
||||||
var n = require("Storage").read("choozi.save");
|
setN(read());
|
||||||
if (n !== undefined) setN(parseInt(n));
|
|
||||||
else setN(defaultN);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (process.env.HWVERSION == 1){
|
if (process.env.HWVERSION == 1){
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue