Fix channel sort not working
This commit is contained in:
parent
a899b1b46d
commit
04d86a3550
@ -66,10 +66,7 @@ import NetworkLobby from "./NetworkLobby.vue";
|
||||
import Channel from "./Channel.vue";
|
||||
import JoinChannel from "./JoinChannel.vue";
|
||||
|
||||
// TODO: ignoreSortSync should be removed
|
||||
import {findChannel} from "../js/vue";
|
||||
import socket from "../js/socket";
|
||||
// import options from "../js/options";
|
||||
|
||||
export default {
|
||||
name: "NetworkList",
|
||||
@ -99,14 +96,13 @@ export default {
|
||||
type: "networks",
|
||||
order: this.networks.map((n) => n.uuid),
|
||||
});
|
||||
|
||||
// options.settings.ignoreSortSync = true;
|
||||
},
|
||||
onChannelSort(e) {
|
||||
if (!e.moved) {
|
||||
return;
|
||||
}
|
||||
|
||||
const {findChannel} = require("../js/vue");
|
||||
const channel = findChannel(e.moved.element.id);
|
||||
|
||||
if (!channel) {
|
||||
@ -118,8 +114,6 @@ export default {
|
||||
target: channel.network.uuid,
|
||||
order: channel.network.channels.map((c) => c.id),
|
||||
});
|
||||
|
||||
// options.settings.ignoreSortSync = true;
|
||||
},
|
||||
},
|
||||
};
|
||||
|
@ -2,15 +2,8 @@
|
||||
|
||||
const $ = require("jquery");
|
||||
const socket = require("../socket");
|
||||
const options = require("../options");
|
||||
|
||||
socket.on("sync_sort", function(data) {
|
||||
// Syncs the order of channels or networks when they are reordered
|
||||
if (options.ignoreSortSync) {
|
||||
options.ignoreSortSync = false;
|
||||
return; // Ignore syncing because we 'caused' it
|
||||
}
|
||||
|
||||
const type = data.type;
|
||||
const order = data.order;
|
||||
const container = $(".networks");
|
||||
|
Loading…
Reference in New Issue
Block a user