summaryrefslogtreecommitdiffhomepage
path: root/gui/src
diff options
context:
space:
mode:
Diffstat (limited to 'gui/src')
-rw-r--r--gui/src/renderer/app.tsx29
1 files changed, 1 insertions, 28 deletions
diff --git a/gui/src/renderer/app.tsx b/gui/src/renderer/app.tsx
index c8950f88c8..c37f52bd4f 100644
--- a/gui/src/renderer/app.tsx
+++ b/gui/src/renderer/app.tsx
@@ -47,34 +47,7 @@ import { LogLevel } from '../shared/logging-types';
import IpcOutput from './lib/logging';
import { RoutePath } from './lib/routes';
-// This function wraps all IPC calls to catch errors and then rethrow them without the
-// "Uncaught Error:" prefix that's added by Electron.
-// This is a temporary workaround which won't be required after this Electron PR has been merged and
-// released: https://github.com/electron/electron/pull/28346
-function handleReponse(ipc: typeof window.ipc): typeof window.ipc {
- const wrappedIpc: Record<string, Record<string, unknown>> = {};
-
- Object.entries(ipc).forEach(([groupName, group]) => {
- wrappedIpc[groupName] = {} as typeof group;
-
- Object.entries(group).forEach(([fnName, fn]) => {
- wrappedIpc[groupName][fnName] = (...args: Parameters<typeof fn>) => {
- const response = fn(...args);
- if (response instanceof Promise) {
- return response.catch((error: Error) => {
- throw new Error(error.message?.replace(/^Uncaught Error: /, ''));
- });
- } else {
- return response;
- }
- };
- });
- });
-
- return wrappedIpc as typeof window.ipc;
-}
-
-const IpcRendererEventChannel = handleReponse(window.ipc);
+const IpcRendererEventChannel = window.ipc;
interface IPreferredLocaleDescriptor {
name: string;