@iobroker/adapter-react-v5 3.1.33 → 3.1.34

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.
@@ -2927,11 +2927,11 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
2927
2927
 
2928
2928
  return props.socket.getObjectView(null, null, props.types[0]);
2929
2929
  } else {
2930
- return props.socket.getObject('system.config').then(function (obj) {
2930
+ return !objects['system.config'] ? props.socket.getObject('system.config').then(function (obj) {
2931
2931
  return {
2932
2932
  'system.config': obj
2933
2933
  };
2934
- });
2934
+ }) : Promise.resolve(null);
2935
2935
  }
2936
2936
  }).then(function (moreObjects) {
2937
2937
  _this2.systemConfig = objects['system.config'] || moreObjects['system.config'] || {};
@@ -3594,7 +3594,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
3594
3594
  function subscribe(id) {
3595
3595
  if (!this.subscribes.includes(id)) {
3596
3596
  this.subscribes.push(id);
3597
- console.log('+ subscribe ' + id);
3597
+ console.log("+ subscribe ".concat(id));
3598
3598
  !this.pausedSubscribes && this.props.socket.subscribeState(id, this.onStateChange);
3599
3599
  }
3600
3600
  }
@@ -3615,7 +3615,7 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
3615
3615
  delete this.states[id];
3616
3616
  }
3617
3617
 
3618
- console.log('- unsubscribe ' + id);
3618
+ console.log("- unsubscribe ".concat(id));
3619
3619
  this.props.socket.unsubscribeState(id, this.onStateChange);
3620
3620
 
3621
3621
  if (this.pausedSubscribes) {
@@ -4846,7 +4846,8 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
4846
4846
  });
4847
4847
  },
4848
4848
  "aria-labelledby": "enum-dialog-title",
4849
- open: true
4849
+ open: !0 // true
4850
+
4850
4851
  }, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], {
4851
4852
  id: "enum-dialog-title"
4852
4853
  }, type === 'func' ? this.props.t('ra_Define functions') : this.props.t('ra_Define rooms'), /*#__PURE__*/_react["default"].createElement(_Fab["default"], {
@@ -6261,19 +6262,37 @@ var ObjectBrowser = /*#__PURE__*/function (_Component) {
6261
6262
  return _this44.onSelect(obj._id);
6262
6263
  });
6263
6264
  })["catch"](function (e) {
6264
- return _this44.showError('Cannot write object: ' + e);
6265
+ return _this44.showError("Cannot write object: ".concat(e));
6265
6266
  });
6266
6267
  },
6267
6268
  onClose: function onClose(obj) {
6268
- _this44.setState({
6269
- editObjectDialog: ''
6270
- });
6271
-
6272
6269
  if (obj) {
6273
- _this44.props.socket.setObject(obj._id, obj)["catch"](function (e) {
6274
- return _this44.showError('Cannot write object: ' + e);
6270
+ var updateAlias;
6271
+
6272
+ if (_this44.state.editObjectDialog.startsWith('alias.')) {
6273
+ var _this44$objects$_this, _obj$common5;
6274
+
6275
+ if (JSON.stringify((_this44$objects$_this = _this44.objects[_this44.state.editObjectDialog].common) === null || _this44$objects$_this === void 0 ? void 0 : _this44$objects$_this.alias) !== JSON.stringify((_obj$common5 = obj.common) === null || _obj$common5 === void 0 ? void 0 : _obj$common5.alias)) {
6276
+ updateAlias = _this44.state.editObjectDialog;
6277
+ }
6278
+ }
6279
+
6280
+ _this44.props.socket.setObject(obj._id, obj).then(function () {
6281
+ if (updateAlias && _this44.subscribes.includes(updateAlias)) {
6282
+ _this44.unsubscribe(updateAlias);
6283
+
6284
+ setTimeout(function () {
6285
+ return _this44.subscribe(updateAlias);
6286
+ }, 100);
6287
+ }
6288
+ })["catch"](function (e) {
6289
+ return _this44.showError("Cannot write object: ".concat(e));
6275
6290
  });
6276
6291
  }
6292
+
6293
+ _this44.setState({
6294
+ editObjectDialog: ''
6295
+ });
6277
6296
  }
6278
6297
  });
6279
6298
  }