diff --git a/src/renderer/coremods/installer/index.tsx b/src/renderer/coremods/installer/index.tsx index 0d260f6a2..ce7498b59 100644 --- a/src/renderer/coremods/installer/index.tsx +++ b/src/renderer/coremods/installer/index.tsx @@ -1,7 +1,14 @@ +import { parser } from "@common"; import { Injector } from "@replugged"; +import type { Capture, DefaultInRule } from "simple-markdown"; +import { plugins } from "src/renderer/managers/plugins"; +import { themes } from "src/renderer/managers/themes"; import { filters, waitForModule } from "src/renderer/modules/webpack"; import { ObjectExports } from "src/types"; import { registerRPCCommand } from "../rpc"; +import { generalSettings } from "../settings/pages"; +import AddonEmbed from "./AddonEmbed"; +import { loadCommands } from "./commands"; import { InstallLinkProps, InstallResponse, @@ -9,13 +16,6 @@ import { installFlow, parseInstallLink, } from "./util"; -import { plugins } from "src/renderer/managers/plugins"; -import { themes } from "src/renderer/managers/themes"; -import AddonEmbed from "./AddonEmbed"; -import { generalSettings } from "../settings/pages"; -import type { Capture, DefaultInRule } from "simple-markdown"; -import { parser } from "@common"; -import { loadCommands } from "./commands"; const injector = new Injector(); @@ -91,10 +91,10 @@ async function injectLinks(): Promise { raw: true, }); const exports = linkMod.exports as ObjectExports & { - default: React.FC>; + Anchor: React.FC>; }; - injector.instead(exports, "default", (args, fn) => { + injector.instead(exports, "Anchor", (args, fn) => { const { href } = args[0]; if (!href) return fn(...args); const installLink = parseInstallLink(href); @@ -102,9 +102,7 @@ async function injectLinks(): Promise { args[0].onClick = (e) => triggerInstall(installLink, e); - const res = fn(...args); - - return res; + return fn(...args); }); const defaultRules = parser.defaultRules as typeof parser.defaultRules & {