tempfix for people using old installer

This commit is contained in:
Zack Rauen 2018-10-22 16:57:05 -04:00
parent 5aad0a0b99
commit b6c2733f4b
2 changed files with 5 additions and 4 deletions

View File

@ -1805,23 +1805,24 @@ var BdApi = {
const path = require("path");
const location = path.resolve(base, "..", "app", "config.json");
const fs = require("fs");
if (!fs.existsSync(path.resolve(base, "..", "app"))) return this._windowConfigFile = null;
if (!fs.existsSync(location)) fs.writeFileSync(location, JSON.stringify({}));
return this._windowConfigFile = location;
}
};
BdApi.getAllWindowPreferences = function() {
if (bdConfig.os !== "win32") return {}; // Tempfix until new injection on other platforms
if (bdConfig.os !== "win32" || !this.WindowConfigFile) return {}; // Tempfix until new injection on other platforms
return require(this.WindowConfigFile);
};
BdApi.getWindowPreference = function(key) {
if (bdConfig.os !== "win32") return undefined; // Tempfix until new injection on other platforms
if (bdConfig.os !== "win32" || !this.WindowConfigFile) return undefined; // Tempfix until new injection on other platforms
return this.getAllWindowPreferences()[key];
};
BdApi.setWindowPreference = function(key, value) {
if (bdConfig.os !== "win32") return // Tempfix until new injection on other platforms
if (bdConfig.os !== "win32" || !this.WindowConfigFile) return; // Tempfix until new injection on other platforms
const fs = require("fs");
const prefs = this.getAllWindowPreferences();
prefs[key] = value;

2
js/main.min.js vendored

File diff suppressed because one or more lines are too long