Implement renumeration of ordered tags upon collision

I was being bitten by this enough for me to want to fix it. This implementation really ought to be improved such that it doesnt tend towards being broken the more it is used.
This commit is contained in:
Luke Barnard 2017-12-01 18:20:38 +00:00
parent e80c4fadea
commit b0d115a64a

View File

@ -360,7 +360,13 @@ var RoomSubList = React.createClass({
if (order === orderA || order === orderB) {
console.error("Cannot describe new list position. This should be incredibly unlikely.");
// TODO: renumber the list
this.state.sortedList.forEach((room, index) => {
MatrixClientPeg.get().setRoomTag(
room.roomId, this.props.tagName,
{order: index / this.state.sortedList.length},
);
});
return index / this.state.sortedList.length;
}
return order;