Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanBluefox committed Apr 28, 2020
2 parents 602dc11 + bfda816 commit 4b6428f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@iobroker/adapter-react",
"version": "0.3.6",
"version": "0.3.8",
"description": "React classes to develop admin interfaces for ioBroker with react.",
"author": {
"name": "bluefox",
Expand Down
8 changes: 5 additions & 3 deletions src/Components/SelectID.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,11 @@ function applyFilter(item, filters, lang, objects, context) {
filteredOut = item.data.fID.indexOf(context.id) === -1;
}
if (!filteredOut && context.name) {
if (item.data.fName === undefined) {
if (item.data.fName === undefined || item.data.fName === null) {
item.data.fName = (item.data.obj && item.data.obj.common && getName(item.data.obj.common.name, lang)) || '';
item.data.fName = item.data.fName.toLowerCase();
item.data.fName = (item.data.fName || '').toString().toLowerCase();
}
filteredOut = item.data.fName.indexOf(context.name) === -1;
filteredOut = item.data.fName.toString().indexOf(context.name) === -1;
}
if (!filteredOut && filters.role) {
filteredOut = !(item.data && item.data.obj && item.data.obj.common && item.data.obj.common.role && item.data.obj.common.role.startsWith(context.role));
Expand All @@ -250,6 +250,7 @@ function applyFilter(item, filters, lang, objects, context) {
}
item.data.visible = !filteredOut;
item.data.hasVisibleChildren = false;

if (item.children) {
item.children.forEach(_item => {
const visible = applyFilter(_item, filters, lang, objects, context);
Expand All @@ -258,6 +259,7 @@ function applyFilter(item, filters, lang, objects, context) {
}
});
}

return item.data.visible || item.data.hasVisibleChildren;
}

Expand Down

0 comments on commit 4b6428f

Please sign in to comment.