Skip to content

Commit

Permalink
Fix session update script issues
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo committed Dec 15, 2023
1 parent 7b084cc commit 2c5009a
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions addons/io_hubs_addon/hubs_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,8 @@

JS_STATE_UPDATE = """
let params = { signedIn: false, entered: false, roomName: "" };
if (arguments[0]) {
try { params["signedIn"] = APP?.hubChannel?.signedIn; } catch(e) {};
}
if (params["signedIn"]) {
try { params["entered"] = APP?.hubChannel?.signedIn; } catch(e) {};
}
try { params["signedIn"] = APP?.hubChannel?.signedIn; } catch(e) {};
try { params["entered"] = APP?.scene?.is("entered"); } catch(e) {};
try { params["roomName"] = APP?.hub?.name || APP?.hub?.slug || APP?.hub?.hub_id; } catch(e) {};
return params;
"""
Expand Down Expand Up @@ -145,7 +141,7 @@ def update_session_state(self):
params = parse_qs(parsed.query, keep_blank_values=True)
self._room_params = {k: v for k, v in params.items() if k != "hub_id"}

params = self._web_driver.execute_script(JS_STATE_UPDATE, "debugLocalScene" in self._room_params)
params = self._web_driver.execute_script(JS_STATE_UPDATE)
self._user_logged_in = params["signedIn"]
self._user_in_room = params["entered"]
self._room_name = params["roomName"]
Expand Down

0 comments on commit 2c5009a

Please sign in to comment.