mirror of
https://github.com/lhns/steam-frame-nix.git
synced 2026-10-06 01:00:13 +02:00
VR keyboard extra keys: the helper reconnects when Steam's page closes while connecting
A CDP call sent after the socket closed (e.g. Steam restarting between Runtime.enable and the first inject) waited forever, so the helper hung instead of reconnecting. Such calls now resolve empty at once.
This commit is contained in:
1 parent
514f073a6e
commit
c99b0b699f
1 file changed
+1
@@ -52,6 +52,7 @@ async function session() {
|
||||
let id = 0;
|
||||
const pending = new Map();
|
||||
const call = (method, params = {}) => new Promise((res) => {
|
||||
if (ws.readyState !== WebSocket.OPEN) return res({}); // closed: never answered
|
||||
const i = ++id; pending.set(i, res); ws.send(JSON.stringify({ id: i, method, params }));
|
||||
});
|
||||
let last; // logged when it changes (e.g. a signature error once, not every 15 s)
|
||||
|
||||
Reference in new issue
Block a user