+save status start

This commit is contained in:
Miki 2024-01-02 15:39:05 +00:00
parent aa1a4a6b4d
commit 85aa46d591

View file

@ -27,7 +27,7 @@
$: min = 0;
$: sec = 0;
$: end = false;
$: start = false;
// $: start = false;
function resetHeat() {
heat = {
@ -85,13 +85,13 @@
min = min_sec[0];
sec = min_sec[1];
// console.log(`min & sec = ${min} & ${sec}`);
if (!start) {
start = true;
if (!$priority.start) {
$priority.start = true;
}
} else if (Msg.mode === 'stop') {
console.log(`stop duration: ${Msg.duration}`);
end = true;
start = false;
$priority.start = false;
}
};
return () => {
@ -125,7 +125,7 @@
}
});
console.log(`retval: ${JSON.stringify(res)}`);
start = true;
$priority.start = true;
end = false;
}
@ -228,7 +228,7 @@
{:else}
<div class="timer" style="color: red">{pad2(min)}:{pad2(sec)}</div>
{/if}
{#if start}
{#if $priority.start}
<Button handleClick={() => startHeat()} label="STOP" />
{:else}
<Button handleClick={() => startHeat()} label="START" />