Skip to content

Commit b0d115a

Browse files
committed
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.
1 parent e80c4fa commit b0d115a

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎src/components/structures/RoomSubList.js‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,13 @@ var RoomSubList = React.createClass({
360360

361361
if (order === orderA || order === orderB) {
362362
console.error("Cannot describe new list position. This should be incredibly unlikely.");
363-
// TODO: renumber the list
363+
this.state.sortedList.forEach((room, index) => {
364+
MatrixClientPeg.get().setRoomTag(
365+
room.roomId, this.props.tagName,
366+
{order: index / this.state.sortedList.length},
367+
);
368+
});
369+
return index / this.state.sortedList.length;
364370
}
365371

366372
return order;

0 commit comments

Comments
 (0)