fix(gui): hide lists with [object Object] in advanced settings (#9743)
As discussed in https://github.com/syncthing/syncthing/pull/9175#discussion_r1730431703, entries in advanced settings are unusable if they are comprised of a list of objects. It just displays `[object Object], [object Object], [object Object]`, e.g. for the devices a folder is shared with. Filter out these config elements by detecting an array whose members are not all strings or numbers, and setting them to `skip` type. Fix some unnecessary repetition in calling `inputTypeFor()`, since it is already cached in the `ng-init` directive.
This commit is contained in:
@@ -3343,6 +3343,11 @@ angular.module('syncthing.core')
|
||||
return 'checkbox';
|
||||
}
|
||||
if (value instanceof Array) {
|
||||
if (value.some(function (element) {
|
||||
return typeof element !== 'number' && typeof element !== 'string';
|
||||
})) {
|
||||
return 'skip';
|
||||
}
|
||||
return 'list';
|
||||
}
|
||||
if (typeof value === 'object') {
|
||||
|
||||
Reference in New Issue
Block a user