Fix VencordToolbox
This commit is contained in:
parent
6c4afa52a3
commit
ddee3e1264
|
@ -24,11 +24,14 @@ import ErrorBoundary from "@components/ErrorBoundary";
|
||||||
import { Devs } from "@utils/constants";
|
import { Devs } from "@utils/constants";
|
||||||
import { LazyComponent } from "@utils/react";
|
import { LazyComponent } from "@utils/react";
|
||||||
import definePlugin from "@utils/types";
|
import definePlugin from "@utils/types";
|
||||||
import { findByCode } from "@webpack";
|
import { filters, find } from "@webpack";
|
||||||
import { Menu, Popout, useState } from "@webpack/common";
|
import { Menu, Popout, useState } from "@webpack/common";
|
||||||
import type { ReactNode } from "react";
|
import type { ReactNode } from "react";
|
||||||
|
|
||||||
const HeaderBarIcon = LazyComponent(() => findByCode(".HEADER_BAR_BADGE,", ".tooltip"));
|
const HeaderBarIcon = LazyComponent(() => {
|
||||||
|
const filter = filters.byCode(".HEADER_BAR_BADGE");
|
||||||
|
return find(m => m.Icon && filter(m.Icon)).Icon;
|
||||||
|
});
|
||||||
|
|
||||||
function VencordPopout(onClose: () => void) {
|
function VencordPopout(onClose: () => void) {
|
||||||
const pluginEntries = [] as ReactNode[];
|
const pluginEntries = [] as ReactNode[];
|
||||||
|
@ -137,7 +140,7 @@ export default definePlugin({
|
||||||
|
|
||||||
patches: [
|
patches: [
|
||||||
{
|
{
|
||||||
find: ".mobileToolbar",
|
find: "toolbar:function",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /(?<=toolbar:function.{0,100}\()\i.Fragment,/,
|
match: /(?<=toolbar:function.{0,100}\()\i.Fragment,/,
|
||||||
replace: "$self.ToolboxFragmentWrapper,"
|
replace: "$self.ToolboxFragmentWrapper,"
|
||||||
|
|
Loading…
Reference in a new issue