newOrder defaults `null`, allows check for `newOrder` on line 357

pull/21833/head
lukebarnard 2018-01-19 14:12:21 +00:00
parent 54f6d305d7
commit 6106b3ce44
1 changed files with 4 additions and 2 deletions

View File

@ -310,7 +310,7 @@ module.exports = React.createClass({
const hasChangedSubLists = result.source.droppableId !== result.destination.droppableId;
const newOrder = {};
let newOrder = null;
// Is the tag ordered manually?
if (newTag && !newTag.match(/^(m\.lowpriority|im\.vector\.fake\.(invite|recent|direct|archived))$/)) {
@ -327,7 +327,9 @@ module.exports = React.createClass({
const nextOrder = newIndex === newList.length ?
1 : newList[offset + newIndex].tags[newTag].order;
newOrder['order'] = (prevOrder + nextOrder) / 2.0;
newOrder = {
order: (prevOrder + nextOrder) / 2.0,
};
}
// More evilness: We will still be dealing with moving to favourites/low prio,