diff --git a/Routes/dashboard.js b/Routes/dashboard.js index 672f75c..14281d2 100644 --- a/Routes/dashboard.js +++ b/Routes/dashboard.js @@ -122,7 +122,7 @@ module.exports = (app, config, themeConfig) => { }; } - if (c.optionType.type == "spacer") { /* ... */ } else { + if (c.optionType.type === "spacer" || c.optionType.type === "multiRow" || c.optionType.type === "embedBuilder") { /* ... */ } else { if (!actual[s.categoryId]) actual[s.categoryId] = {}; if (!actual[s.categoryId][c.optionId]) { diff --git a/Routes/discord.js b/Routes/discord.js index be59a82..3639d4d 100644 --- a/Routes/discord.js +++ b/Routes/discord.js @@ -120,7 +120,7 @@ module.exports = (app, config, themeConfig) => { OAuth2UserResponse = await oauth.getUser(OAuth2Response.access_token); } catch (err) { - console.log("Discord.js Route - OAuth2UserResponse (line 122)\n" + err); + console.log("Discord.js Route - OAuth2UserResponse (line 123)\n" + err); req.session.discordAuthStatus = { loading: false, @@ -204,7 +204,7 @@ module.exports = (app, config, themeConfig) => { OAuth2GuildsResponse = await oauth.getUserGuilds(OAuth2Response.access_token); } catch (err) { - req.config.reportError("Discord.js Route - OAuth2GuildsResponse (line 205)\n" + err); + req.config.reportError("Discord.js Route - OAuth2GuildsResponse (line 207)\n" + err); req.session.discordAuthStatus = { loading: false, @@ -294,7 +294,7 @@ module.exports = (app, config, themeConfig) => { */ }); } catch (err) { - req.config.reportError("Discord.js Route - guildAfterAuthorization (line 295)" + err); + req.config.reportError("Discord.js Route - guildAfterAuthorization (line 297)" + err); } } @@ -341,7 +341,7 @@ module.exports = (app, config, themeConfig) => { try { OAuth2GuildsResponse = await oauth.getUserGuilds(access_token); } catch (err) { - req.config.reportError("Discord.js Route - OAuth2GuildsResponse for ReloadGuilds (line 342)" + err); + req.config.reportError("Discord.js Route - OAuth2GuildsResponse for ReloadGuilds (line 344)" + err); return res.send({ error: true, diff --git a/package.json b/package.json index 6e3da0a..8dd0a59 100644 --- a/package.json +++ b/package.json @@ -26,9 +26,7 @@ "test": "echo \"Error: no test specified\" && exit 1" }, "devDependencies": { - "dbd-dark-dashboard": "^1.6.58", "eslint": "^8.23.0", - "javascript-obfuscator": "^4.0.0", "prettier": "2.7.1" }, "eslintConfig": { diff --git a/theme/dbd-soft-ui/index.js b/theme/dbd-soft-ui/index.js index ae49749..4746bf0 100644 --- a/theme/dbd-soft-ui/index.js +++ b/theme/dbd-soft-ui/index.js @@ -1,7 +1,7 @@ const consolePrefix = `${"[".blue}${"dbd-soft-ui".yellow}${"]".blue} `; const Keyv = require("keyv"); const path = require("path"); -const { readFileSync } = require("fs"); +// const { readFileSync } = require("fs"); module.exports = (themeConfig = {}) => { return { @@ -20,7 +20,7 @@ module.exports = (themeConfig = {}) => { addonLoaded: `${consolePrefix}${"Successfully loaded {{ADDON}}.".cyan}`, }, }, - embedBuilderComponent: readFileSync(path.join(__dirname, "/embedBuilderComponent.txt"), "utf8"), + // embedBuilderComponent: readFileSync(path.join(__dirname, "/embedBuilderComponent.txt"), "utf8"), init: async (app, config) => { if (!config?.useTheme404) return console.log(`${consolePrefix}${"You need to set useTheme404 to true in your DBD config otherwise Soft-UI will not work correctly!\n\nDashboard has not fully initialised due to this. Pages will 404!".red}`); diff --git a/theme/dbd-soft-ui/utils/functions/settingsPage.js b/theme/dbd-soft-ui/utils/functions/settingsPage.js index ca83235..c8ea9e9 100644 --- a/theme/dbd-soft-ui/utils/functions/settingsPage.js +++ b/theme/dbd-soft-ui/utils/functions/settingsPage.js @@ -167,7 +167,12 @@ module.exports = function (config, themeConfig) { if (!actual[s.categoryId]) actual[s.categoryId] = {}; - if (c.optionType.type == "spacer") { + if (c.optionType.type == "embedBuilder") { + actual[s.categoryId][c.optionId] = { + type: "embedBuilder", + themeOptions: c.themeOptions, + }; + } else if (c.optionType.type == "spacer") { actual[s.categoryId][c.optionId] = { type: "spacer", themeOptions: c.themeOptions, @@ -196,6 +201,7 @@ module.exports = function (config, themeConfig) { } continue; } + actual[s.categoryId][c.optionId] = await c.getActualSet({ guild: { id: req.params.id, diff --git a/theme/dbd-soft-ui/views/admin.ejs b/theme/dbd-soft-ui/views/admin.ejs index 9aa24e3..b72e753 100644 --- a/theme/dbd-soft-ui/views/admin.ejs +++ b/theme/dbd-soft-ui/views/admin.ejs @@ -586,25 +586,6 @@ -