From ddee3e12642f75954f579f68a788ffc960082434 Mon Sep 17 00:00:00 2001
From: Vendicated <vendicated@riseup.net>
Date: Wed, 25 Oct 2023 23:00:04 +0200
Subject: [PATCH] Fix VencordToolbox

---
 src/plugins/vencordToolbox/index.tsx | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/plugins/vencordToolbox/index.tsx b/src/plugins/vencordToolbox/index.tsx
index dd2cc115..ba55fdee 100644
--- a/src/plugins/vencordToolbox/index.tsx
+++ b/src/plugins/vencordToolbox/index.tsx
@@ -24,11 +24,14 @@ import ErrorBoundary from "@components/ErrorBoundary";
 import { Devs } from "@utils/constants";
 import { LazyComponent } from "@utils/react";
 import definePlugin from "@utils/types";
-import { findByCode } from "@webpack";
+import { filters, find } from "@webpack";
 import { Menu, Popout, useState } from "@webpack/common";
 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) {
     const pluginEntries = [] as ReactNode[];
@@ -137,7 +140,7 @@ export default definePlugin({
 
     patches: [
         {
-            find: ".mobileToolbar",
+            find: "toolbar:function",
             replacement: {
                 match: /(?<=toolbar:function.{0,100}\()\i.Fragment,/,
                 replace: "$self.ToolboxFragmentWrapper,"