From b88be8014e3fd2e76df7ac6a2be63ce821d2071a Mon Sep 17 00:00:00 2001 From: Vendicated Date: Thu, 6 Jun 2024 02:55:18 +0200 Subject: [PATCH] experiments: change toolbar help button -> dev menu --- src/plugins/experiments/hideBugReport.css | 3 +++ src/plugins/experiments/index.tsx | 14 ++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 src/plugins/experiments/hideBugReport.css diff --git a/src/plugins/experiments/hideBugReport.css b/src/plugins/experiments/hideBugReport.css new file mode 100644 index 000000000..ff78555d7 --- /dev/null +++ b/src/plugins/experiments/hideBugReport.css @@ -0,0 +1,3 @@ +#staff-help-popout-staff-help-bug-reporter { + display: none; +} diff --git a/src/plugins/experiments/index.tsx b/src/plugins/experiments/index.tsx index 626e06a99..cf4dbf249 100644 --- a/src/plugins/experiments/index.tsx +++ b/src/plugins/experiments/index.tsx @@ -16,6 +16,7 @@ * along with this program. If not, see . */ +import { disableStyle, enableStyle } from "@api/Styles"; import ErrorBoundary from "@components/ErrorBoundary"; import { ErrorCard } from "@components/ErrorCard"; import { Devs } from "@utils/constants"; @@ -24,6 +25,8 @@ import definePlugin from "@utils/types"; import { findByPropsLazy } from "@webpack"; import { Forms, React } from "@webpack/common"; +import hideBugReport from "./hideBugReport.css?managed"; + const KbdStyles = findByPropsLazy("key", "removeBuildOverride"); export default definePlugin({ @@ -58,9 +61,20 @@ export default definePlugin({ match: 'title:"Experiments",children:[', replace: "$&$self.WarningCard()," } + }, + // change top right chat toolbar button from the help one to the dev one + { + find: "toolbar:function", + replacement: { + match: /\i\.isStaff\(\)/, + replace: "true" + } } ], + start: () => enableStyle(hideBugReport), + stop: () => disableStyle(hideBugReport), + settingsAboutComponent: () => { const isMacOS = navigator.platform.includes("Mac"); const modKey = isMacOS ? "cmd" : "ctrl";