From de9122b05b20c22d9d59bad08e6eb2e2e2ca017e Mon Sep 17 00:00:00 2001 From: AutumnVN Date: Thu, 28 Mar 2024 12:43:05 +0700 Subject: [PATCH] fix ImageZoom, LoadingQuote, NoRPC, RevealAllSpoilers, SecretRingTone (#2306) --- src/plugins/imageZoom/index.tsx | 4 ++-- src/plugins/loadingQuotes/index.ts | 4 ++-- src/plugins/noRPC.discordDesktop/index.ts | 2 +- src/plugins/revealAllSpoilers/index.ts | 4 ++-- src/plugins/secretRingTone/index.ts | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/plugins/imageZoom/index.tsx b/src/plugins/imageZoom/index.tsx index cbaa07d2a..3f0e3294a 100644 --- a/src/plugins/imageZoom/index.tsx +++ b/src/plugins/imageZoom/index.tsx @@ -23,7 +23,7 @@ import { makeRange } from "@components/PluginSettings/components"; import { debounce } from "@shared/debounce"; import { Devs } from "@utils/constants"; import definePlugin, { OptionType } from "@utils/types"; -import { Menu, React, ReactDOM } from "@webpack/common"; +import { Menu, ReactDOM } from "@webpack/common"; import type { Root } from "react-dom/client"; import { Magnifier, MagnifierProps } from "./components/Magnifier"; @@ -168,7 +168,7 @@ export default definePlugin({ }, { - find: "handleImageLoad=", + find: ".handleImageLoad)", replacement: [ { match: /placeholderVersion:\i,/, diff --git a/src/plugins/loadingQuotes/index.ts b/src/plugins/loadingQuotes/index.ts index eed5b3ec5..97178979c 100644 --- a/src/plugins/loadingQuotes/index.ts +++ b/src/plugins/loadingQuotes/index.ts @@ -81,11 +81,11 @@ export default definePlugin({ find: ".LOADING_DID_YOU_KNOW}", replacement: [ { - match: /\._loadingText=function\(\)\{/, + match: /"_loadingText",function\(\)\{/, replace: "$&return $self.quote;", }, { - match: /\._eventLoadingText=function\(\)\{/, + match: /"_eventLoadingText",function\(\)\{/, replace: "$&return $self.quote;", predicate: () => settings.store.replaceEvents } diff --git a/src/plugins/noRPC.discordDesktop/index.ts b/src/plugins/noRPC.discordDesktop/index.ts index ebbbd5e8f..4c6319e5e 100644 --- a/src/plugins/noRPC.discordDesktop/index.ts +++ b/src/plugins/noRPC.discordDesktop/index.ts @@ -27,7 +27,7 @@ export default definePlugin({ { find: '.ensureModule("discord_rpc")', replacement: { - match: /\.ensureModule\("discord_rpc"\)\.then\(\(.+?\)\)}/, + match: /\.ensureModule\("discord_rpc"\)\.then\(\(.+?\)}\)}/, replace: '.ensureModule("discord_rpc")}', }, }, diff --git a/src/plugins/revealAllSpoilers/index.ts b/src/plugins/revealAllSpoilers/index.ts index 746973b42..e728181aa 100644 --- a/src/plugins/revealAllSpoilers/index.ts +++ b/src/plugins/revealAllSpoilers/index.ts @@ -30,9 +30,9 @@ export default definePlugin({ patches: [ { - find: ".removeObscurity=", + find: ".removeObscurity,", replacement: { - match: /(?<=\.removeObscurity=(\i)=>{)/, + match: /(?<="removeObscurity",(\i)=>{)/, replace: (_, event) => `$self.reveal(${event});` } } diff --git a/src/plugins/secretRingTone/index.ts b/src/plugins/secretRingTone/index.ts index 9d6d6a155..8f0176f88 100644 --- a/src/plugins/secretRingTone/index.ts +++ b/src/plugins/secretRingTone/index.ts @@ -16,7 +16,7 @@ export default definePlugin({ { find: "call_ringing_beat\"", replacement: { - match: /500===\i\.random\(1,1e3\)/, + match: /500===\i\(\)\.random\(1,1e3\)/, replace: "true" } },