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.pull/5759/head
parent
e80c4fadea
commit
b0d115a64a
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue