Adding an apiary if sorting by anything other than the default sort causes the marker assignment to fail. For example, in this case, the latest apiary was assigned "B" instead of "D", because the last apiary in the sequence had the marker "A":
Fix this by making a copy of the array from Redux and sorting that. Or by generating a list of ApiaryCards from the Redux array and sorting that.
Because the visual sorting of apiary cards is done by sorting the list of apiaries in place:
https://github.com/project-icp/bee-pollinator-app/blob/6204798cb3cf52a7ce601b603ff7137080166aee/src/icp/apps/beekeepers/js/src/components/Sidebar.jsx#L41-L58
Adding an apiary if sorting by anything other than the default sort causes the marker assignment to fail. For example, in this case, the latest apiary was assigned "B" instead of "D", because the last apiary in the sequence had the marker "A":
Fix this by making a copy of the array from Redux and sorting that. Or by generating a list of
ApiaryCard
s from the Redux array and sorting that.