|
@@ -146,10 +146,11 @@ class Air:
|
|
|
if client_id not in Client.instances:
|
|
|
return
|
|
|
client = Client.instances[client_id]
|
|
|
- if data['msg']['args'] and data['msg']['args'][0].startswith('{"socket_id":'):
|
|
|
- args = json.loads(data['msg']['args'][0])
|
|
|
- args['socket_id'] = client_id # HACK: translate socket_id of ui.scene's init event
|
|
|
- data['msg']['args'][0] = json.dumps(args)
|
|
|
+ args = data['msg']['args']
|
|
|
+ if args and isinstance(args[0], str) and args[0].startswith('{"socket_id":'):
|
|
|
+ arg0 = json.loads(args[0])
|
|
|
+ arg0['socket_id'] = client_id # HACK: translate socket_id of ui.scene's init event
|
|
|
+ args[0] = json.dumps(arg0)
|
|
|
client.handle_event(data['msg'])
|
|
|
|
|
|
@self.relay.on('javascript_response')
|