add a manager for builtin modules
This commit is contained in:
parent
983763c48d
commit
e21583eafd
|
@ -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();
|
||||||
|
}
|
||||||
|
}
|
|
@ -2,3 +2,4 @@ export { default as EmoteModule } from './EmoteModule';
|
||||||
export { default as ReactDevtoolsModule } from './ReactDevtoolsModule';
|
export { default as ReactDevtoolsModule } from './ReactDevtoolsModule';
|
||||||
export { default as VueDevtoolsModule } from './VueDevToolsModule';
|
export { default as VueDevtoolsModule } from './VueDevToolsModule';
|
||||||
export { default as TrackingProtection } from './TrackingProtection';
|
export { default as TrackingProtection } from './TrackingProtection';
|
||||||
|
export { default as BuiltinManager } from './Manager';
|
||||||
|
|
|
@ -12,7 +12,7 @@ import { DOM, BdUI, BdMenu, Modals, Reflection, Toasts } from 'ui';
|
||||||
import BdCss from './styles/index.scss';
|
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 { 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 { 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 electron from 'electron';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
|
||||||
|
@ -73,9 +73,6 @@ class BetterDiscord {
|
||||||
|
|
||||||
async init() {
|
async init() {
|
||||||
try {
|
try {
|
||||||
ReactDevtoolsModule.init();
|
|
||||||
VueDevtoolsModule.init();
|
|
||||||
TrackingProtection.init();
|
|
||||||
await Database.init();
|
await Database.init();
|
||||||
await Settings.loadSettings();
|
await Settings.loadSettings();
|
||||||
await ModuleManager.initModules();
|
await ModuleManager.initModules();
|
||||||
|
@ -91,7 +88,7 @@ class BetterDiscord {
|
||||||
|
|
||||||
Events.emit('ready');
|
Events.emit('ready');
|
||||||
Events.emit('discord-ready');
|
Events.emit('discord-ready');
|
||||||
EmoteModule.init();
|
BuiltinManager.initAll();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
Logger.err('main', ['FAILED TO LOAD!', err]);
|
Logger.err('main', ['FAILED TO LOAD!', err]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue