-- Leo's gemini proxy
-- Connecting to git.thebackupbox.net:1965...
-- Connected
-- Sending request
-- Meta line: 20 text/gemini
repo: janusweb action: commit revision: path_from: revision_from: 21ed88c19e22143762914cc009fb9b90f4fec99b: path_to: revision_to:
commit 21ed88c19e22143762914cc009fb9b90f4fec99b Author: James Baicoianu <james_github@baicoianu.com> Date: Sun Oct 31 01:49:14 2021 -0700 Improved object.setRoom() logic diff --git a/scripts/janusbase.js b/scripts/janusbase.js
--- a/scripts/janusbase.js +++ b/scripts/janusbase.js @@ -1352,9 +1352,10 @@ console.log('clone', props); } } this.setRoom = function(newroom, ischild) { - if (newroom._target) newroom = newroom._target; // If the proxy object is passed in, use its target instead + if (newroom && newroom._target) newroom = newroom._target; // If the proxy object is passed in, use its target instead if (this.room !== newroom) { + let oldroom = this.room; if (!ischild) { this.stop(); } @@ -1364,7 +1365,13 @@ console.log('clone', props); this.children[k].setRoom(newroom, true); } } - if (!ischild) { + if (newroom && !ischild) { + let roomproxy = (newroom._target ? newroom : newroom.getProxyObject()), + objproxy = (this._target ? this : this.getProxyObject()); + if (!roomproxy.contains(objproxy)) { + //newroom.add(this); + roomproxy.appendChild(objproxy); + } this.start(); } }
-----END OF PAGE-----
-- Response ended
-- Page fetched on Sun Jun 2 18:20:43 2024