From eff05c52262fb4e7909d650ef75f8b36bfb650fa Mon Sep 17 00:00:00 2001 From: Oj Date: Fri, 28 Jan 2022 19:05:07 +0000 Subject: [PATCH] [IPCMain] Remove completely --- src/ipcMain.js | 5 ----- src/splash/splashScreen.js | 6 +++--- 2 files changed, 3 insertions(+), 8 deletions(-) delete mode 100644 src/ipcMain.js diff --git a/src/ipcMain.js b/src/ipcMain.js deleted file mode 100644 index a8a663e..0000000 --- a/src/ipcMain.js +++ /dev/null @@ -1,5 +0,0 @@ -// Discord's wrapper around ipcMain -const { ipcMain } = require('electron'); - -exports.on = (event, callback) => ipcMain.on('DISCORD_' + event, callback); -exports.removeListener = (event, callback) => ipcMain.removeListener('DISCORD_' + event, callback); \ No newline at end of file diff --git a/src/splash/splashScreen.js b/src/splash/splashScreen.js index d67bd5f..96763ec 100644 --- a/src/splash/splashScreen.js +++ b/src/splash/splashScreen.js @@ -28,7 +28,7 @@ var _securityUtils = require("../utils/securityUtils"); var _updater = require("../updater/updater"); -var _ipcMain = _interopRequireDefault(require("../ipcMain")); +const ipcMain = _electron.ipcMain; function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } @@ -453,7 +453,7 @@ function launchSplashWindow(startMinimized) { }); } - _ipcMain.default.on('SPLASH_SCREEN_READY', () => { + ipcMain.on('DISCORD_SPLASH_SCREEN_READY', () => { log('Splash', 'Window declared ready, showing and starting update process'); if (oaConfig.themeSync !== false) try { // Inject themesync CSS @@ -470,7 +470,7 @@ function launchSplashWindow(startMinimized) { } }); - _ipcMain.default.on('SPLASH_SCREEN_QUIT', () => { + ipcMain.on('DISCORD_SPLASH_SCREEN_QUIT', () => { _electron.app.quit(); });