diff --git a/client/src/builtin/Manager.js b/client/src/builtin/Manager.js new file mode 100644 index 00000000..4d941a03 --- /dev/null +++ b/client/src/builtin/Manager.js @@ -0,0 +1,13 @@ +import { default as EmoteModule } from './EmoteModule'; +import { default as ReactDevtoolsModule } from './ReactDevtoolsModule'; +import { default as VueDevtoolsModule } from './VueDevToolsModule'; +import { default as TrackingProtection } from './TrackingProtection'; + +export default class { + static initAll() { + EmoteModule.init(); + ReactDevtoolsModule.init(); + VueDevtoolsModule.init(); + TrackingProtection.init(); + } +} diff --git a/client/src/builtin/builtin.js b/client/src/builtin/builtin.js index 55816205..e1255b03 100644 --- a/client/src/builtin/builtin.js +++ b/client/src/builtin/builtin.js @@ -2,3 +2,4 @@ export { default as EmoteModule } from './EmoteModule'; export { default as ReactDevtoolsModule } from './ReactDevtoolsModule'; export { default as VueDevtoolsModule } from './VueDevToolsModule'; export { default as TrackingProtection } from './TrackingProtection'; +export { default as BuiltinManager } from './Manager'; diff --git a/client/src/index.js b/client/src/index.js index cb3a4f36..82bc3972 100644 --- a/client/src/index.js +++ b/client/src/index.js @@ -12,7 +12,7 @@ import { DOM, BdUI, BdMenu, Modals, Reflection, Toasts } from 'ui'; import BdCss from './styles/index.scss'; import { Events, CssEditor, Globals, Settings, Database, Updater, ModuleManager, PluginManager, ThemeManager, ExtModuleManager, Vendor, WebpackModules, Patcher, MonkeyPatch, ReactComponents, ReactHelpers, ReactAutoPatcher, DiscordApi, BdWebApi, Connectivity } from 'modules'; import { ClientLogger as Logger, ClientIPC, Utils } from 'common'; -import { EmoteModule, ReactDevtoolsModule, VueDevtoolsModule, TrackingProtection } from 'builtin'; +import { BuiltinManager, EmoteModule, ReactDevtoolsModule, VueDevtoolsModule, TrackingProtection } from 'builtin'; import electron from 'electron'; import path from 'path'; @@ -73,9 +73,6 @@ class BetterDiscord { async init() { try { - ReactDevtoolsModule.init(); - VueDevtoolsModule.init(); - TrackingProtection.init(); await Database.init(); await Settings.loadSettings(); await ModuleManager.initModules(); @@ -91,7 +88,7 @@ class BetterDiscord { Events.emit('ready'); Events.emit('discord-ready'); - EmoteModule.init(); + BuiltinManager.initAll(); } catch (err) { Logger.err('main', ['FAILED TO LOAD!', err]); }