Fix device selection reset issue in LED Strip Testing
- Fix frontend device selection state management to properly update selected board when boards_changed event is triggered - Optimize backend board status checking to only emit boards_changed events when there are actual changes - Prevent unnecessary UI updates and improve performance Fixes issue where device selection would reset to unselected state shortly after selection
This commit is contained in:
@ -58,7 +58,10 @@ export const LedStripTest = () => {
|
||||
board.port === currentBoard.port
|
||||
);
|
||||
|
||||
if (!stillExists) {
|
||||
if (stillExists) {
|
||||
// Update to the new board object to reflect any status changes
|
||||
setSelectedBoard(stillExists);
|
||||
} else {
|
||||
// Current board is no longer available, select first available or null
|
||||
setSelectedBoard(boardList.length > 0 ? boardList[0] : null);
|
||||
}
|
||||
|
Reference in New Issue
Block a user