Skip to content

Commit 81dda2c

Browse files
committed
Make more finds not depend on non mangled keys
1 parent 7415367 commit 81dda2c

4 files changed

Lines changed: 13 additions & 9 deletions

File tree

src/plugins/betterFolders/FolderSideBar.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,13 @@
1717
*/
1818

1919
import ErrorBoundary from "@components/ErrorBoundary";
20-
import { findByPropsLazy, findComponentByCodeLazy, findStoreLazy } from "@webpack";
21-
import { useStateFromStores } from "@webpack/common";
20+
import { findComponentByCodeLazy, findStoreLazy } from "@webpack";
21+
import { Animations, useStateFromStores } from "@webpack/common";
2222
import type { CSSProperties } from "react";
2323

2424
import { ExpandedGuildFolderStore, settings } from ".";
2525

2626
const ChannelRTCStore = findStoreLazy("ChannelRTCStore");
27-
const Animations = findByPropsLazy("a", "animated", "useTransition");
2827
const GuildsBar = findComponentByCodeLazy('("guildsnav")');
2928

3029
export default ErrorBoundary.wrap(guildsBarProps => {

src/plugins/reviewDB/auth.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,12 @@
77
import { DataStore } from "@api/index";
88
import { Logger } from "@utils/Logger";
99
import { openModal } from "@utils/modal";
10-
import { findByPropsLazy } from "@webpack";
11-
import { showToast, Toasts, UserStore } from "@webpack/common";
10+
import { OAuth2AuthorizeModal, showToast, Toasts, UserStore } from "@webpack/common";
1211

1312
import { ReviewDBAuth } from "./entities";
1413

1514
const DATA_STORE_KEY = "rdb-auth";
1615

17-
const { OAuth2AuthorizeModal } = findByPropsLazy("OAuth2AuthorizeModal");
18-
1916
export let Auth: ReviewDBAuth = {};
2017

2118
export async function initAuth() {

src/plugins/webContextMenus.web/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,13 @@ import { definePluginSettings } from "@api/Settings";
2020
import { Devs } from "@utils/constants";
2121
import definePlugin, { OptionType } from "@utils/types";
2222
import { saveFile } from "@utils/web";
23-
import { findByPropsLazy } from "@webpack";
23+
import { filters, mapMangledModuleLazy } from "@webpack";
2424
import { Clipboard, ComponentDispatch } from "@webpack/common";
2525

26-
const ctxMenuCallbacks = findByPropsLazy("contextMenuCallbackNative");
26+
const ctxMenuCallbacks = mapMangledModuleLazy('.tagName)==="TEXTAREA"||', {
27+
contextMenuCallbackWeb: filters.byCode('.tagName)==="INPUT"||'),
28+
contextMenuCallbackNative: filters.byCode('.tagName)==="TEXTAREA"||')
29+
});
2730

2831
async function fetchImage(url: string) {
2932
const res = await fetch(url);

src/webpack/common/components.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,8 @@ export const MaskedLink = waitForComponent<t.MaskedLink>("MaskedLink", filters.c
9595
export const Timestamp = waitForComponent<t.Timestamp>("Timestamp", filters.componentByCode("#{intl::MESSAGE_EDITED_TIMESTAMP_A11Y_LABEL}"));
9696
export const Flex = waitForComponent<t.Flex>("Flex", ["Justify", "Align", "Wrap"]);
9797
export const OAuth2AuthorizeModal = waitForComponent("OAuth2AuthorizeModal", filters.componentByCode(".authorize),children:", ".contentBackground"));
98+
99+
export const Animations = mapMangledModuleLazy(".assign({colorNames:", {
100+
Transition: filters.componentByCode('["items","children"]', ",null,"),
101+
animated: filters.byProps("div", "text")
102+
});

0 commit comments

Comments
 (0)