diff --git a/assets/locales/en-us.json b/assets/locales/en-us.json index a358436c..52f68164 100644 --- a/assets/locales/en-us.json +++ b/assets/locales/en-us.json @@ -165,7 +165,11 @@ "isEnabled": "Enabled", "listView": "List View", "gridView": "Grid View", + "enableAll": "Enable All", + "disableAll": "Disable All", + "enableAllWarning": "Enabling all {{type}} can cause temporary lag and unexpected errors.\n\n(Hold shift while clicking to skip this prompt!)", "search": "Search {{type}}", + "results": "{{count}} Results", "editAddon": "Edit", "deleteAddon": "Delete", "confirmDelete": "Are you sure you want to delete {{name}}?", @@ -189,14 +193,7 @@ "wasUnloaded": "{{name}} was unloaded.", "blankSlateHeader": "You don't have any {{type}}s!", "blankSlateMessage": "Grab some from [this website]({{link}}) and add them to your {{type}} folder.", - "isEnabled": "Enabled", - "wasLoaded": "{{name}} v{{version}} was loaded.", - "listView": "List View", - "gridView": "Grid View", - "enableAll": "Enable All", - "disableAll": "Disable All", - "results": "{{count}} Results", - "enableAllWarning": "Enabling all {{type}} can cause temporary lag and unexpected errors.\n\n(Hold shift while clicking to skip this prompt!)" + "wasLoaded": "{{name}} v{{version}} was loaded." }, "CustomCSS": { "confirmationText": "You have unsaved changes to your Custom CSS. Closing this window will lose all those changes.", @@ -258,5 +255,8 @@ "versionAvailable": "Version {{version}} now available!", "upToDateBlankslate": "All of your {{type}} seem to be up to date!", "updateButton": "Update!" + }, + "Settings": { + "customColor": "Custom Color" } } \ No newline at end of file diff --git a/renderer/src/builtins/developer/debuglogs.js b/renderer/src/builtins/developer/debuglogs.js index cd1b8f3b..a1a98237 100644 --- a/renderer/src/builtins/developer/debuglogs.js +++ b/renderer/src/builtins/developer/debuglogs.js @@ -69,6 +69,8 @@ export default new class DebugLogs extends Builtin { async checkFilesize() { try { + // Not been created yet, no need to check filesize + if (!fs.existsSync(this.logFile)) return; const stats = fs.statSync(this.logFile); const mb = stats.size / (1024 * 1024); if (mb < 100) return; // Under 100MB, all good diff --git a/renderer/src/builtins/general/contextmenu.js b/renderer/src/builtins/general/contextmenu.js index 0fa3efff..b5047728 100644 --- a/renderer/src/builtins/general/contextmenu.js +++ b/renderer/src/builtins/general/contextmenu.js @@ -32,10 +32,10 @@ export default new class BDContextMenu extends Builtin { callback(retVal) { const items = Settings.collections.map(c => this.buildCollectionMenu(c)); - items.push({label: Strings.panels.updates, action: () => {this.openCategory("updates");}}); - if (Settings.get("settings", "customcss", "customcss")) items.push({label: Strings.panels.customcss, action: () => {this.openCategory("customcss");}}); - items.push(this.buildAddonMenu(Strings.panels.plugins, pluginManager)); - items.push(this.buildAddonMenu(Strings.panels.themes, themeManager)); + items.push({label: Strings.Panels.updates, action: () => {this.openCategory("updates");}}); + if (Settings.get("settings", "customcss", "customcss")) items.push({label: Strings.Panels.customcss, action: () => {this.openCategory("customcss");}}); + items.push(this.buildAddonMenu(Strings.Panels.plugins, pluginManager)); + items.push(this.buildAddonMenu(Strings.Panels.themes, themeManager)); retVal?.props?.children?.props?.children?.[0].push(ContextMenu.buildItem({type: "separator"})); retVal?.props?.children?.props?.children?.[0].push(ContextMenu.buildItem({type: "submenu", label: "BetterDiscord", items: items})); } diff --git a/renderer/src/modules/webpackmodules.js b/renderer/src/modules/webpackmodules.js index 1595752c..674642af 100644 --- a/renderer/src/modules/webpackmodules.js +++ b/renderer/src/modules/webpackmodules.js @@ -524,7 +524,7 @@ export default class WebpackModules { catch (error) { Logger.stacktrace("WebpackModules", "Could not patch pushed module", error); } - finally{ + finally { require.m[moduleId] = originalModule; } }; diff --git a/renderer/src/styles/ui/addonlist.css b/renderer/src/styles/ui/addonlist.css index fa74266d..a1b7638f 100644 --- a/renderer/src/styles/ui/addonlist.css +++ b/renderer/src/styles/ui/addonlist.css @@ -17,6 +17,7 @@ } .bd-controls, +.bd-controls-basic, .bd-controls-advanced { display: flex; } diff --git a/renderer/src/styles/ui/sidebar.css b/renderer/src/styles/ui/sidebar.css index 4ab912ed..f9d22cbc 100644 --- a/renderer/src/styles/ui/sidebar.css +++ b/renderer/src/styles/ui/sidebar.css @@ -21,6 +21,7 @@ .bd-sidebar-header .bd-changelog-button { height: 16px; + padding: 0; } .bd-sidebar-header .bd-icon { @@ -28,6 +29,6 @@ fill: var(--interactive-normal); } -.bd-sidebar-header .bd-icon:hover { +.bd-sidebar-header .bd-changelog-button:hover .bd-icon { fill: var(--interactive-hover); } diff --git a/renderer/src/ui/base/button.jsx b/renderer/src/ui/base/button.jsx index 8e428cb9..11ff696d 100644 --- a/renderer/src/ui/base/button.jsx +++ b/renderer/src/ui/base/button.jsx @@ -51,7 +51,8 @@ export default function Button({ look = Looks.FILLED, color = Colors.BRAND, size = Sizes.MEDIUM, - grow = true + grow = true, + ...others }) { const handleClick = useCallback(event => { @@ -60,7 +61,7 @@ export default function Button({ onClick?.(event); }, [onClick]); - return } + {(props) => } ; } diff --git a/renderer/src/ui/settings/components/color.jsx b/renderer/src/ui/settings/components/color.jsx index 924d4ca5..b8e2418e 100644 --- a/renderer/src/ui/settings/components/color.jsx +++ b/renderer/src/ui/settings/components/color.jsx @@ -1,5 +1,6 @@ import React from "@modules/react"; import DiscordModules from "@modules/discordmodules"; +import Strings from "@modules/strings"; const {useState, useCallback} = React; @@ -76,7 +77,7 @@ export default function Color({value: initialValue, onChange, colors = defaultCo )} - + {props => (
diff --git a/renderer/src/ui/settings/components/search.jsx b/renderer/src/ui/settings/components/search.jsx index 1f8b504f..6c8c4619 100644 --- a/renderer/src/ui/settings/components/search.jsx +++ b/renderer/src/ui/settings/components/search.jsx @@ -1,4 +1,5 @@ import React from "@modules/react"; +import Button from "@ui/base/button"; import Close from "@ui/icons/close"; import SearchIcon from "@ui/icons/search"; @@ -23,12 +24,14 @@ export default function Search({onChange, className, onKeyDown, placeholder}) { const reset = useCallback(() => { onChange?.({target: {value: ""}}); setValue(""); - }, [onChange]); + if (!input.current) return; + input.current.focus(); + }, [onChange, input]); return
{!value && } - {value && } + {value && }
; } \ No newline at end of file diff --git a/renderer/src/ui/settings/sidebarheader.jsx b/renderer/src/ui/settings/sidebarheader.jsx index 8190e776..83b458fd 100644 --- a/renderer/src/ui/settings/sidebarheader.jsx +++ b/renderer/src/ui/settings/sidebarheader.jsx @@ -7,6 +7,7 @@ import Strings from "@modules/strings"; import HistoryIcon from "@ui/icons/history"; import Modals from "@ui/modals"; +import Button from "@ui/base/button"; export default function SettingsTitle() { @@ -14,9 +15,9 @@ export default function SettingsTitle() {

BetterDiscord

{props => -
Modals.showChangelogModal(Changelog)}> +
+ }
;