diff --git a/src/modules/datastore.js b/src/modules/datastore.js index 91d35966..6a266d05 100644 --- a/src/modules/datastore.js +++ b/src/modules/datastore.js @@ -1,5 +1,6 @@ import {Config} from "data"; import Utilities from "./utilities"; +import Logger from "./logger"; const fs = require("fs"); const path = require("path"); const releaseChannel = DiscordNative.globals ? DiscordNative.globals.releaseChannel : DiscordNative.app ? DiscordNative.app.getReleaseChannel() : "stable"; @@ -48,9 +49,9 @@ export default new class DataStore { let customcss = ""; let favoriteEmotes = {}; try {customcss = oldData.bdcustomcss ? atob(oldData.bdcustomcss) : "";} - catch (e) {console.error(e);} // eslint-disable-line no-console + catch (e) {Logger.stacktrace("DataStore:convertOldData", "Error decoding custom css", e);} try {favoriteEmotes = oldData.bdfavemotes ? JSON.parse(atob(oldData.bdfavemotes)) : {};} - catch (e) {console.error(e);} // eslint-disable-line no-console + catch (e) {Logger.stacktrace("DataStore:convertOldData", "Error decoding favorite emotes", e);} for (const channel of channels) { if (!fs.existsSync(path.resolve(this.baseFolder, channel))) fs.mkdirSync(path.resolve(this.baseFolder, channel)); const channelData = oldData.settings[channel]; @@ -70,8 +71,8 @@ export default new class DataStore { setChannelData(channel, "settings", newSettings); // settingsCookie setChannelData(channel, "emotes", newEmotes); // emotes (from settingsCookie) - setChannelData(channel, "plugins", channelData.plugins); // pluginCookie - setChannelData(channel, "themes", channelData.themes); // themeCookie + setChannelData(channel, "plugins", channelData.plugins || {}); // pluginCookie + setChannelData(channel, "themes", channelData.themes || {}); // themeCookie setChannelData(channel, "misc", {favoriteEmotes}); // favorite emotes fs.writeFileSync(path.resolve(this.baseFolder, channel, "custom.css"), customcss); // customcss } diff --git a/src/structs/psconnection.js b/src/structs/psconnection.js index 286a85e1..8dea3aa2 100644 --- a/src/structs/psconnection.js +++ b/src/structs/psconnection.js @@ -97,8 +97,8 @@ export default class PublicServersConnection { static get windowOptions() { return { - width: 380, - height: 450, + width: 490, + height: 500, backgroundColor: "#282b30", show: true, resizable: true, diff --git a/src/ui/settings/addonlist.jsx b/src/ui/settings/addonlist.jsx index 93a698d6..c3609a7c 100644 --- a/src/ui/settings/addonlist.jsx +++ b/src/ui/settings/addonlist.jsx @@ -110,7 +110,7 @@ export default class AddonList extends React.Component { matches = matches || addon.description.toLocaleLowerCase().includes(this.state.query); if (!matches) return null; } - const hasSettings = addon.type && typeof(addon.instance.getSettingsPanel) === "function"; + const hasSettings = addon.instance && typeof(addon.instance.getSettingsPanel) === "function"; const getSettings = hasSettings && addon.instance.getSettingsPanel.bind(addon.instance); return ; })}