fix home status not being saved

This commit is contained in:
osiu97
2026-07-08 19:39:43 +02:00
parent c6f73a3b8d
commit 9e683838d3
+8 -1
View File
@@ -218,13 +218,20 @@ async function jogMotor(motor, delta) {
async function zeroMotor(motor) {
const cmd = motor === 'ALL' ? 'HOMEALL' : `HOME${motor}`;
if (motor === 'ALL') {
localStorage.setItem('wiji_homed', 'true');
}
if (BLE.isConnected()) {
await BLE.write(cmd).catch(e => UI.log(e.message, 'error'));
const warningEl = document.getElementById('home-warning');
if (warningEl) warningEl.style.display = localStorage.getItem('wiji_homed') === 'true' ? 'none' : 'block';
} else {
if (motor === 'ALL') {
steps1 = IK.ARM.HOME_STEPS.m1;
steps2 = IK.ARM.HOME_STEPS.m2;
localStorage.setItem('wiji_homed', 'true');
} else if (motor === 1) {
steps1 = IK.ARM.HOME_STEPS.m1;
} else {