Skip to content
This repository was archived by the owner on Apr 5, 2022. It is now read-only.

Commit a5fac96

Browse files
Fix communication errors in the networking rewrite
1 parent a099bba commit a5fac96

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Diff for: assets/n64Interface.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ const activeRequests = {};
22

33
window.addEventListener('load', () => {
44
window.oot.requestComplete((requestId, ...args) => {
5+
// Act on the returned request if its id exists as a key of activeRequests
56
if (activeRequests.hasOwnProperty(requestId)) {
6-
activeRequests[requestId](...args);
7+
activeRequests[requestId].apply(null, [args]);
78
delete activeRequests[requestId];
89
}
910
});

Diff for: preload.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ contextBridge.exposeInMainWorld('oot', {
2727
disconnectAllClients: () => ipcRenderer.send('disconnectAllClients'),
2828

2929
// Function listenable by renderer to allow IPCMain to report a completed request
30-
requestComplete: (callback) => ipcRenderer.on('requestComplete', (event, ...args) => callback(...args)),
30+
requestComplete: (callback) => ipcRenderer.on('requestComplete', (event, ...args) => callback.apply(null, ...args)),
3131

3232
// Function listenable by renderer to allow IPCMain to report a connected or disconnected client
3333
deviceConnected: (callback) => ipcRenderer.on('deviceConnected', (event, connected) => callback(connected)),

0 commit comments

Comments
 (0)