refactor: simplify rpc code (#2823)

This commit is contained in:
Alex Yang
2023-06-19 23:27:27 +08:00
committed by GitHub
parent 775d6212d3
commit b73c75182f
4 changed files with 32 additions and 47 deletions

View File

@@ -92,7 +92,7 @@ class HelperProcessManager {
...appMethods,
};
const server = AsyncCall<PeersAPIs.HelperToMain>(mainToHelperServer, {
this.rpc = AsyncCall<PeersAPIs.HelperToMain>(mainToHelperServer, {
strict: {
// the channel is shared for other purposes as well so that we do not want to
// restrict to only JSONRPC messages
@@ -100,7 +100,6 @@ class HelperProcessManager {
},
channel: new MessageEventChannel(this.#process),
});
this.rpc = server;
}
}

View File

@@ -66,6 +66,5 @@ app
.then(ensureHelperProcess)
.then(restoreOrCreateWindow)
.then(createApplicationMenu)
.then()
.then(registerUpdater)
.catch(e => console.error('Failed create window:', e));