From f6613ca200866d3f982c56002912644363b9bb65 Mon Sep 17 00:00:00 2001 From: Zack Rauen Date: Thu, 27 Feb 2020 17:09:08 -0500 Subject: [PATCH] fix criticals --- js/main.js | 25 +++---------------------- src/bdApi.js | 2 +- src/contentManager.js | 4 ++-- src/core.js | 2 +- 4 files changed, 7 insertions(+), 26 deletions(-) diff --git a/js/main.js b/js/main.js index 14e3164..f6c59d0 100644 --- a/js/main.js +++ b/js/main.js @@ -87,25 +87,6 @@ var Core = /************************************************************************/ /******/ ({ -/***/ "./src sync recursive": -/*!******************!*\ - !*** ./src sync ***! - \******************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -function webpackEmptyContext(req) { - var e = new Error("Cannot find module '" + req + "'"); - e.code = 'MODULE_NOT_FOUND'; - throw e; -} -webpackEmptyContext.keys = function() { return []; }; -webpackEmptyContext.resolve = webpackEmptyContext; -module.exports = webpackEmptyContext; -webpackEmptyContext.id = "./src sync recursive"; - -/***/ }), - /***/ "./src/0globals.js": /*!*************************!*\ !*** ./src/0globals.js ***! @@ -138,7 +119,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _0gl /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _0globals__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./0globals */ \"./src/0globals.js\");\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./core */ \"./src/core.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ \"./src/utils.js\");\n/* harmony import */ var _v2__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./v2 */ \"./src/v2.js\");\n/* harmony import */ var _dataStore__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./dataStore */ \"./src/dataStore.js\");\n\n\n\n\n\nconst BdApi = {\n get React() {\n return _v2__WEBPACK_IMPORTED_MODULE_3__[\"default\"].react;\n },\n\n get ReactDOM() {\n return _v2__WEBPACK_IMPORTED_MODULE_3__[\"default\"].reactDom;\n },\n\n get WindowConfigFile() {\n if (this._windowConfigFile) return this._windowConfigFile;\n\n const electron = __webpack_require__(/*! electron */ \"electron\").remote.app;\n\n const path = __webpack_require__(/*! path */ \"path\");\n\n const base = electron.getAppPath();\n const roamingBase = electron.getPath(\"userData\");\n const roamingLocation = path.resolve(roamingBase, electron.getVersion(), \"modules\", \"discord_desktop_core\", \"injector\", \"config.json\");\n const location = path.resolve(base, \"..\", \"app\", \"config.json\");\n\n const fs = __webpack_require__(/*! fs */ \"fs\");\n\n const realLocation = fs.existsSync(location) ? location : fs.existsSync(roamingLocation) ? roamingLocation : null;\n if (!realLocation) return this._windowConfigFile = null;\n return this._windowConfigFile = realLocation;\n }\n\n};\n\nBdApi.getAllWindowPreferences = function () {\n if (!this.WindowConfigFile) return {}; // Tempfix until new injection on other platforms\n\n return require(this.WindowConfigFile);\n};\n\nBdApi.getWindowPreference = function (key) {\n if (!this.WindowConfigFile) return undefined; // Tempfix until new injection on other platforms\n\n return this.getAllWindowPreferences()[key];\n};\n\nBdApi.setWindowPreference = function (key, value) {\n if (!this.WindowConfigFile) return; // Tempfix until new injection on other platforms\n\n const fs = __webpack_require__(/*! fs */ \"fs\");\n\n const prefs = this.getAllWindowPreferences();\n prefs[key] = value;\n delete __webpack_require__.c[this.WindowConfigFile];\n fs.writeFileSync(this.WindowConfigFile, JSON.stringify(prefs, null, 4));\n}; //Inject CSS to document head\n//id = id of element\n//css = custom css\n\n\nBdApi.injectCSS = function (id, css) {\n $(\"head\").append($(\"