Potential final fix for #30

This commit is contained in:
Logan Cusano
2023-06-23 17:48:28 -04:00
parent 47d18c494d
commit 7163df21e9
4 changed files with 48 additions and 34 deletions

View File

@@ -109,7 +109,7 @@ class nodeObject {
* @param {*} param0._ip The IP that the master can contact the node at
* @param {*} param0._port The port that the client is listening on
* @param {*} param0._location The physical location of the node
* @param {*} param0._online True/False if the node is online or offline
* @param {*} param0._online True/False if the node is online or offline
* @param {*} param0._nearbySystems An object array of nearby systems
*/
constructor({ _id = undefined, _name = undefined, _ip = undefined, _port = undefined, _location = undefined, _nearbySystems = undefined, _online = undefined }) {
@@ -117,10 +117,9 @@ class nodeObject {
this.name = _name;
this.ip = _ip;
this.port = _port;
this.location = _location;
if (_nearbySystems && Array.isArray(_nearbySystems)) this.nearbySystems = _nearbySystems;
else if (_nearbySystems) this.nearbySystems = Object.keys(_nearbySystems);
else this.nearbySystems = _nearbySystems;
this.location = _location;
this.nearbySystems = _nearbySystems;
if (this.nearbySystems) this.presets = Object.keys(_nearbySystems);
this.online = _online;
}
}