From a5792f3c42bad56e4df77449e00362ff4ebd3ade Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Colomb?= Date: Mon, 13 Sep 2021 20:41:15 +0200 Subject: [PATCH] gui: Sort already shared devices in edit folder modal (fixes #7940) (#7945) The list of unshared devices is built from deviceList(), which sorts the result. But the shared devices are listed in undefined order from the unsorted currentFolder.devices array. Apply the same sorting after building the array used in the dialog. --- gui/default/syncthing/core/syncthingController.js | 1 + 1 file changed, 1 insertion(+) diff --git a/gui/default/syncthing/core/syncthingController.js b/gui/default/syncthing/core/syncthingController.js index 2426b9e49..8bc487264 100755 --- a/gui/default/syncthing/core/syncthingController.js +++ b/gui/default/syncthing/core/syncthingController.js @@ -799,6 +799,7 @@ angular.module('syncthing.core') } $scope.currentSharing.selected[n.deviceID] = true; }); + $scope.currentSharing.shared.sort(deviceCompare); $scope.currentSharing.unrelated = $scope.deviceList().filter(function (n) { return n.deviceID !== $scope.myID && !$scope.currentSharing.selected[n.deviceID]; });