aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Borg <jakob@kastelo.net>2023-07-07 07:25:24 +0200
committerGitHub <noreply@github.com>2023-07-07 07:25:24 +0200
commit6ff5ed6d232b8e6093c199cd83de0025641447bc (patch)
tree594c742d73d350d88633e3ece0a27de3eb6ea97a
parent25ec2b63abb4d43d37833acdc9cda501febcb2e7 (diff)
downloadsyncthing-6ff5ed6d232b8e6093c199cd83de0025641447bc.tar.gz
syncthing-6ff5ed6d232b8e6093c199cd83de0025641447bc.zip
gui: Avoid spurious comma in shared-with device list (fixes #8967) (#8970)
-rw-r--r--gui/default/index.html4
-rwxr-xr-xgui/default/syncthing/core/syncthingController.js7
2 files changed, 7 insertions, 4 deletions
diff --git a/gui/default/index.html b/gui/default/index.html
index e5c7db1f2..57cd558a7 100644
--- a/gui/default/index.html
+++ b/gui/default/index.html
@@ -555,8 +555,8 @@
<tr>
<th><span class="fas fa-fw fa-share-alt"></span>&nbsp;<span translate>Shared With</span></th>
<td class="text-right no-overflow-ellipse word-break-all">
- <span ng-repeat="device in folder.devices">
- <span ng-if="device.deviceID != myID" ng-switch="completion[device.deviceID][folder.id].remoteState">
+ <span ng-repeat="device in otherDevices(folder.devices)">
+ <span ng-switch="completion[device.deviceID][folder.id].remoteState">
<span ng-switch-when="notSharing" data-original-title="{{'The remote device has not accepted sharing this folder.' | translate}}" tooltip>{{deviceName(devices[device.deviceID])}}<sup>1</sup><span ng-if="!$last">,</span></span>
<span ng-switch-when="paused" data-original-title="{{'The remote device has paused this folder.' | translate}}" tooltip>{{deviceName(devices[device.deviceID])}}<sup>2</sup><span ng-if="!$last">,</span></span>
<span ng-switch-default>{{deviceName(devices[device.deviceID])}}<span ng-if="!$last">,</span></span>
diff --git a/gui/default/syncthing/core/syncthingController.js b/gui/default/syncthing/core/syncthingController.js
index 208cb5617..6a77e514e 100755
--- a/gui/default/syncthing/core/syncthingController.js
+++ b/gui/default/syncthing/core/syncthingController.js
@@ -1892,8 +1892,11 @@ angular.module('syncthing.core')
}
};
- $scope.otherDevices = function () {
- return $scope.deviceList().filter(function (n) {
+ $scope.otherDevices = function (devices) {
+ if (devices === undefined) {
+ devices = $scope.deviceList();
+ }
+ return devices.filter(function (n) {
return n.deviceID !== $scope.myID;
});
};