Closed ajax333221 closed 1 year ago
At the end, I didn't do either of these:
-change removeBoard(board); to removeBoard(board.boardName); with some comment.
-or, make board still reference the board_fenGet by never killing the reference.
I decided to keep the board name as a string instead, and remove the board with it.
With the recent changes,
removeBoard(board);
takes the boardfake_board_fenGet
and attempts to remove it instead of removing the boardboard_fenGet
.Resulting in the board showing in some places:
Ic.getBoardNames()
listing it#ic_ui_board_tabs
when using the UI (but disabled because the isHidden=true)The fix is simple, this should do it:
board = _cloneBoardToObj({ boardName: 'fake_board_fenGet' }, board);
toboard = _cloneBoardToObj({ boardName: board.boardName }, board);
With this, now
removeBoard()
should remove it with no problem, however I am a bit against passing a fake methodless board around, because much of the time, after successfully selecting a board, it is assumed we can call any board methods, so we should also do one of these:removeBoard(board);
toremoveBoard(board.boardName);
with some comment.board_fenGet
by never killing the reference.To prevent future bugs in
removeBoard()
if we ever try to call a board method after selecting it and before deleting it.