From 31678227b911ff54ef3eb9970329aa920a36f773 Mon Sep 17 00:00:00 2001 From: down Date: Sun, 19 Jun 2022 16:18:29 +0700 Subject: [PATCH] fix(widgets): no need to set the same state --- app/src/display/widgets/bongo_cat.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/display/widgets/bongo_cat.c b/app/src/display/widgets/bongo_cat.c index 60aedc1a..a9113500 100644 --- a/app/src/display/widgets/bongo_cat.c +++ b/app/src/display/widgets/bongo_cat.c @@ -59,10 +59,14 @@ void set_bongo_state(struct zmk_widget_bongo_cat *widget, struct zmk_position_st } else { if (current_bongo_state ^ (bongo_state_left | bongo_state_right)) { tmp = bongo_state_none; - widget->is_right = !widget->is_right; /* flip side when return to none state */ + widget->is_right = !widget->is_right; /* switch hand when return to none state */ } } + if (current_bongo_state == tmp) { + return; + } + current_bongo_state = tmp; lv_img_set_src(widget->obj, images[current_bongo_state]); }