@iobroker/adapter-react-v5 3.1.29 → 3.1.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2908,6 +2908,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
2908
2908
  var _this2 = this;
2909
2909
 
2910
2910
  var props = this.props;
2911
+ var objects;
2911
2912
  return new Promise(function (resolve) {
2912
2913
  return _this2.setState({
2913
2914
  updating: true
@@ -2916,8 +2917,33 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
2916
2917
  });
2917
2918
  }).then(function () {
2918
2919
  return _this2.props.objectsWorker ? _this2.props.objectsWorker.getObjects(update) : props.socket.getObjects(update, true);
2919
- }).then(function (objects) {
2920
- _this2.systemConfig = objects['system.config'] || {};
2920
+ }).then(function (_objects) {
2921
+ objects = _objects;
2922
+
2923
+ if (props.types && props.types[0] !== 'state') {
2924
+ if (props.length >= 1) {
2925
+ console.error('more than one type does not supported!');
2926
+ }
2927
+
2928
+ return props.socket.getObjectView(null, null, props.types[0]);
2929
+ } else {
2930
+ return props.socket.getObject('system.config').then(function (obj) {
2931
+ return {
2932
+ 'system.config': obj
2933
+ };
2934
+ });
2935
+ }
2936
+ }).then(function (moreObjects) {
2937
+ _this2.systemConfig = objects['system.config'] || moreObjects['system.config'] || {};
2938
+
2939
+ if (moreObjects) {
2940
+ if (moreObjects['system.config']) {
2941
+ delete moreObjects['system.config'];
2942
+ }
2943
+
2944
+ Object.assign(objects, moreObjects);
2945
+ }
2946
+
2921
2947
  _this2.systemConfig.common = _this2.systemConfig.common || {};
2922
2948
  _this2.systemConfig.common.defaultNewAcl = _this2.systemConfig.common.defaultNewAcl || {};
2923
2949
  _this2.systemConfig.common.defaultNewAcl.owner = _this2.systemConfig.common.defaultNewAcl.owner || 'system.user.admin';
@@ -2947,9 +2973,9 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
2947
2973
  } else if (props.types) {
2948
2974
  _this2.objects = {};
2949
2975
  Object.keys(objects).forEach(function (id) {
2950
- var type = objects[id] && objects[id].type;
2976
+ var type = objects[id] && objects[id].type; // include "folder" types too
2951
2977
 
2952
- if (type && (type === 'channel' || type === 'device' || type === 'enum' || type === 'folder' || type === 'adapter' || type === 'instance' || type === 'chart' || type === 'host' || props.types.includes(type))) {
2978
+ if (type && (type === 'channel' || type === 'device' || type === 'enum' || type === 'folder' || type === 'adapter' || type === 'instance' || props.types.includes(type))) {
2953
2979
  _this2.objects[id] = objects[id];
2954
2980
  }
2955
2981
  });