misc fixes

This commit is contained in:
Nuckyz 2024-05-08 00:25:34 -03:00
parent 4753efa33c
commit 4cc6789b5b
No known key found for this signature in database
GPG key ID: 440BF8296E1C4AD9
4 changed files with 5 additions and 6 deletions

View file

@ -89,8 +89,8 @@ export const isStyleEnabled = (name: string) => requireStyle(name).dom?.isConnec
* // -- plugin.ts --
* import pluginStyle from "./plugin.css?managed";
* import { setStyleVars } from "@api/Styles";
* import { findByPropsLazy } from "@webpack";
* const classNames = findByPropsLazy("thin", "scrollerBase"); // { thin: "thin-31rlnD scrollerBase-_bVAAt", ... }
* import { findByProps } from "@webpack";
* const classNames = findByProps("thin", "scrollerBase"); // { thin: "thin-31rlnD scrollerBase-_bVAAt", ... }
*
* // Inside some plugin method like "start()"
* setStyleClassNames(pluginStyle, classNames);

View file

@ -52,7 +52,6 @@ const PreloadedUserSettingsActionCreators = webpackDependantLazy(() => UserSetti
const AppearanceSettingsActionCreators = webpackDependantLazy(() => searchProtoClassField("appearance", PreloadedUserSettingsActionCreators.ProtoClass));
const ClientThemeSettingsActionsCreators = webpackDependantLazy(() => searchProtoClassField("clientThemeSettings", AppearanceSettingsActionCreators));
const enum EmojiIntentions {
REACTION = 0,
STATUS = 1,

View file

@ -91,7 +91,7 @@ export function proxyLazy<T = any>(factory: () => T, attempts = 5, isChild = fal
// If we're still in the same tick, it means the lazy was immediately used.
// thus, we lazy proxy the get access to make things like destructuring work as expected
// meow here will also be a lazy
// `const { meow } = findByPropsLazy("meow");`
// `const { meow } = proxyLazy(() => ({ meow: [] }));`
if (!isChild && isSameTick) {
return proxyLazy(
() => Reflect.get(target[proxyLazyGet](), p, receiver),

View file

@ -341,7 +341,7 @@ export function findStore<T = any>(name: string) {
* @param filter A function that takes a module and returns a boolean
* @returns The found module or null
*/
export const cacheFind = traceFunction("find", function find(filter: FilterFn) {
export const cacheFind = traceFunction("cacheFind", function cacheFind(filter: FilterFn) {
if (typeof filter !== "function")
throw new Error("Invalid filter. Expected a function got " + typeof filter);
@ -389,7 +389,7 @@ export function cacheFindAll(filter: FilterFn) {
* need it afterwards, pass a copy.
* @returns Array of results in the same order as the passed filters
*/
export const cacheFindBulk = traceFunction("findBulk", function findBulk(...filterFns: FilterFn[]) {
export const cacheFindBulk = traceFunction("cacheFindBulk", function cacheFindBulk(...filterFns: FilterFn[]) {
if (!Array.isArray(filterFns))
throw new Error("Invalid filters. Expected function[] got " + typeof filterFns);