Skip to content

Commit

Permalink
Ignore channel parent in editChannelPosition (#447)
Browse files Browse the repository at this point in the history
  • Loading branch information
Khaaz authored and abalabahaha committed Feb 3, 2019
1 parent f919f96 commit fe5a10f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/Client.js
Expand Up @@ -446,7 +446,12 @@ class Client extends EventEmitter {
}
const min = Math.min(position, channel.position);
const max = Math.max(position, channel.position);
channels = channels.filter((chan) => chan.type === channel.type && chan.parentID === channel.parentID && min <= chan.position && chan.position <= max && chan.id !== channelID).sort((a, b) => a.position - b.position);
channels = channels.filter((chan) => {
return chan.type === channel.type
&& min <= chan.position
&& chan.position <= max
&& chan.id !== channelID;
}).sort((a, b) => a.position - b.position);
if(position > channel.position) {
channels.push(channel);
} else {
Expand Down

0 comments on commit fe5a10f

Please sign in to comment.