Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ptc-rdeleeuw committed Mar 1, 2024
2 parents 1754c61 + cabba89 commit a7d09f1
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 48 deletions.
28 changes: 15 additions & 13 deletions libraries/objectDefaultFiles/object.js
Original file line number Diff line number Diff line change
Expand Up @@ -909,20 +909,22 @@
* Subscribes this socket to data values being written to nodes on this frame
*/
this.sendRealityEditorSubscribe = function () {
var timeoutFunction = function() {
if (spatialObject.object) {
self.ioObject.emit(getIoTitle('/subscribe/realityEditor'), JSON.stringify({
object: spatialObject.object,
frame: spatialObject.frame,
protocol: spatialObject.protocol
}));
let timeout = 10;
function subscribe() {
if (self.ioObject.socket.readyState !== self.ioObject.socket.OPEN) {
if (timeout < 1000) {
timeout *= 10;
}
setTimeout(subscribe, timeout);
return;
}
};
// Call it a few times to help ensure it succeeds
setTimeout(timeoutFunction, 10);
setTimeout(timeoutFunction, 50);
setTimeout(timeoutFunction, 100);
setTimeout(timeoutFunction, 1000);
self.ioObject.emit(getIoTitle('/subscribe/realityEditor'), JSON.stringify({
object: spatialObject.object,
frame: spatialObject.frame,
protocol: spatialObject.protocol
}));
}
subscribe();
};
this.sendRealityEditorSubscribe();

Expand Down
66 changes: 33 additions & 33 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"cors": "^2.8.5",
"decompress-zip": "github:hobinjk-ptc/decompress-zip",
"directory-tree": "^3.5.1",
"express": "^4.18.2",
"express": "^4.18.3",
"express-handlebars": "^5.3.5",
"formidable": "^2.1.1",
"ip": "^2.0.1",
Expand Down

0 comments on commit a7d09f1

Please sign in to comment.