experiments: change toolbar help button -> dev menu

This commit is contained in:
Vendicated 2024-06-06 02:55:18 +02:00
parent e5e8b9ba01
commit b88be8014e
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18
2 changed files with 17 additions and 0 deletions

View file

@ -0,0 +1,3 @@
#staff-help-popout-staff-help-bug-reporter {
display: none;
}

View file

@ -16,6 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
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";