From 04d86a3550a1e6219a9b412288f2debefa947d79 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Sat, 14 Jul 2018 11:06:30 +0300 Subject: [PATCH] Fix channel sort not working --- client/components/NetworkList.vue | 8 +------- client/js/socket-events/sync_sort.js | 7 ------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/client/components/NetworkList.vue b/client/components/NetworkList.vue index 7de2e91b..cc0e0bdd 100644 --- a/client/components/NetworkList.vue +++ b/client/components/NetworkList.vue @@ -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; }, }, }; diff --git a/client/js/socket-events/sync_sort.js b/client/js/socket-events/sync_sort.js index 8910cbf7..feaf45c1 100644 --- a/client/js/socket-events/sync_sort.js +++ b/client/js/socket-events/sync_sort.js @@ -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");