Skip to content

Commit c14d3a6

Browse files
Merge pull request #395 from pollen-robotics/394-flickering-animation-when-startingstoping-reachy-mini
Only refresh UI when state changed.
2 parents 32d7c05 + 04b1048 commit c14d3a6

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "reachy_mini"
7-
version = "1.1.0rc3"
7+
version = "1.1.0rc4"
88
authors = [{ name = "Pollen Robotics", email = "[email protected]" }]
99
description = ""
1010
readme = "README.md"

src/reachy_mini/daemon/app/dashboard/static/js/daemon.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33

44
const daemon = {
5-
currentStatus: {},
5+
currentStatus: {
6+
state: null,
7+
},
68

79
start: async (wakeUp) => {
810
await fetch(`/api/daemon/start?wake_up=${wakeUp}`, {
@@ -44,8 +46,15 @@ const daemon = {
4446
await fetch('/api/daemon/status')
4547
.then((response) => response.json())
4648
.then(async (data) => {
49+
let currentState = daemon.currentStatus.state;
50+
let newState = data.state || null;
51+
4752
daemon.currentStatus = data;
48-
await daemon.updateUI();
53+
54+
if (currentState === null || currentState !== newState) {
55+
await daemon.updateUI();
56+
}
57+
4958
})
5059
.catch((error) => {
5160
console.error('Error fetching daemon status:', error);

0 commit comments

Comments
 (0)