0
0
mirror of https://github.com/Doodle3D/Doodle3D-API synced 2024-12-22 22:03:48 +01:00

better handling when device is connected to wifi-box acces point

This commit is contained in:
casperlamboo 2016-08-19 16:02:11 +02:00
parent 4d77ab2ffe
commit f499693465

View File

@ -18,7 +18,7 @@ export default class Doodle3DManager extends EventDispatcher {
wifiboxid: 'Node JS Server', wifiboxid: 'Node JS Server',
localip: '127.0.0.1:3000' localip: '127.0.0.1:3000'
}*/]; }*/];
this.checkNonServerBoxes = false; this.checkNonServerBoxes = true;
this.autoUpdate = false; this.autoUpdate = false;
} }
@ -39,12 +39,11 @@ export default class Doodle3DManager extends EventDispatcher {
} }
} }
async _checkNew() { async _checkNew() {
let boxes; let boxes = [];
try { try {
boxes = await rest.get(`${ this.api }list.php`); boxes = await rest.get(`${ this.api }list.php`);
} catch(error) { } catch(error) {
console.warn('fail connecting to Doodle3D server'); console.warn('fail connecting to Doodle3D server');
return;
} }
if (this.checkNonServerBoxes) boxes = boxes.concat(this.nonServerBoxes); if (this.checkNonServerBoxes) boxes = boxes.concat(this.nonServerBoxes);