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

Commit

Permalink
Fix error if admin is not on 8081
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanBluefox committed May 1, 2020
1 parent 4b6428f commit a5c4514
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 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.8",
"version": "0.3.9",
"description": "React classes to develop admin interfaces for ioBroker with react.",
"author": {
"name": "bluefox",
Expand Down
2 changes: 1 addition & 1 deletion src/Connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Connection {

this.props.protocol = this.props.protocol || window.location.protocol;
this.props.host = this.props.host || (window.location.host && window.location.host.substr(0, window.location.host.indexOf(':')));
this.props.port = this.props.port || 8081;
this.props.port = this.props.port || (window.location.port === '3000' ? 8081 : window.location.port);

this.socket = window.io.connect(this.props.protocol.replace(':', '') + '://' + this.props.host + ':' + this.props.port,
{query: 'ws=true'});
Expand Down
2 changes: 1 addition & 1 deletion src/GenericApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class GenericApp extends Router {
this.encryptedFields = props.encryptedFields || (settings && settings.encryptedFields) || [];

this.socket = new Connection({
...(props && props.socket),
...((props && props.socket) || (settings && settings.socket)),
doNotLoadAllObjects: (settings && settings.doNotLoadAllObjects),
onProgress: progress => {
if (progress === PROGRESS.CONNECTING) {
Expand Down

0 comments on commit a5c4514

Please sign in to comment.