mirror of
https://github.com/Equicord/Equicord.git
synced 2025-02-25 09:38:52 -05:00
Patch Fixes
This commit is contained in:
parent
7206502f4d
commit
90f2d0895e
9 changed files with 13 additions and 117 deletions
|
@ -10,7 +10,7 @@ You can join our [discord server](https://discord.gg/5Xh2W87egW) for commits, ch
|
||||||
|
|
||||||
### Extra included plugins
|
### Extra included plugins
|
||||||
<details>
|
<details>
|
||||||
<summary>147 additional plugins</summary>
|
<summary>146 additional plugins</summary>
|
||||||
|
|
||||||
### All Platforms
|
### All Platforms
|
||||||
- AllCallTimers by MaxHerbold & D3SOX
|
- AllCallTimers by MaxHerbold & D3SOX
|
||||||
|
@ -90,7 +90,6 @@ You can join our [discord server](https://discord.gg/5Xh2W87egW) for commits, ch
|
||||||
- MessageLoggerEnhanced by Aria
|
- MessageLoggerEnhanced by Aria
|
||||||
- MessagePeek by HypedDomi
|
- MessagePeek by HypedDomi
|
||||||
- MessageTranslate by Samwich
|
- MessageTranslate by Samwich
|
||||||
- ModalFade by Kyuuhachi
|
|
||||||
- MoreStickers by Leko & Arjix
|
- MoreStickers by Leko & Arjix
|
||||||
- NeverPausePreviews by vappstar
|
- NeverPausePreviews by vappstar
|
||||||
- NewPluginsManager by Sqaaakoi
|
- NewPluginsManager by Sqaaakoi
|
||||||
|
|
|
@ -40,7 +40,7 @@ export default definePlugin({
|
||||||
find: "#{intl::HUB_INVITE_ANOTHER_SCHOOL_LINK}",
|
find: "#{intl::HUB_INVITE_ANOTHER_SCHOOL_LINK}",
|
||||||
replacement: [
|
replacement: [
|
||||||
{
|
{
|
||||||
match: /,(\i)&&(\(.{0,15}\i\.TooltipContainer.+)(\i\.\i\.string\(\i\.\i#{intl::GUEST_MEMBERSHIP_EXPLANATION}\))/,
|
match: /,(\i)&&(\(.{0,50}\i\.tooltipContainer.+)(\i\.\i\.string\(\i\.\i#{intl::GUEST_MEMBERSHIP_EXPLANATION}\))/,
|
||||||
replace: ",($1||((!$1)&&arguments[0].invite.expires_at)) && $2$self.RenderTip($1, $3, arguments[0].invite.expires_at)"
|
replace: ",($1||((!$1)&&arguments[0].invite.expires_at)) && $2$self.RenderTip($1, $3, arguments[0].invite.expires_at)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -24,8 +24,8 @@ export default definePlugin({
|
||||||
{
|
{
|
||||||
find: "krisp_browser_models",
|
find: "krisp_browser_models",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /\i:function\(\)\{/,
|
match: /(\i,\{\i:\(\)=>)\i/,
|
||||||
replace: "$&return null;"
|
replace: "$1null"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// Set Krisp to not supported
|
// Set Krisp to not supported
|
||||||
|
|
|
@ -313,9 +313,9 @@ export default definePlugin({
|
||||||
settings,
|
settings,
|
||||||
patches: [
|
patches: [
|
||||||
{
|
{
|
||||||
find: "#{intl::UNREADS_TAB_LABEL}",
|
find: "#{intl::UNREADS_TAB_LABEL})}",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /\i\?\(0,\i\.jsxs\)\(\i\.TabBar\.Item/,
|
match: /\(0,\i\.jsxs\)\(\i\.\i\i\.Item/,
|
||||||
replace: "$self.keywordTabBar(),$&"
|
replace: "$self.keywordTabBar(),$&"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -104,7 +104,7 @@ export default definePlugin({
|
||||||
find: "#{intl::REPLY_QUOTE_MESSAGE_NOT_LOADED}",
|
find: "#{intl::REPLY_QUOTE_MESSAGE_NOT_LOADED}",
|
||||||
replacement: {
|
replacement: {
|
||||||
// Should match two places
|
// Should match two places
|
||||||
match: /(\i\.Clickable),\{/g,
|
match: /(\i\.clickable),\{/g,
|
||||||
replace: "$self.ReplyTooltip,{Component:$1,vcProps:arguments[0],"
|
replace: "$self.ReplyTooltip,{Component:$1,vcProps:arguments[0],"
|
||||||
},
|
},
|
||||||
predicate: () => settings.store.onReply,
|
predicate: () => settings.store.onReply,
|
||||||
|
@ -112,8 +112,8 @@ export default definePlugin({
|
||||||
{
|
{
|
||||||
find: "#{intl::MESSAGE_FORWARDED}",
|
find: "#{intl::MESSAGE_FORWARDED}",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /(\i\.Clickable),\{/,
|
match: /(null:.{0,20})(\i\.\i\i),\{/,
|
||||||
replace: "$self.ForwardTooltip,{Component:$1,vcProps:arguments[0],"
|
replace: "$1$self.ForwardTooltip,{Component:$2,vcProps:arguments[0],"
|
||||||
},
|
},
|
||||||
predicate: () => settings.store.onForward,
|
predicate: () => settings.store.onForward,
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,103 +0,0 @@
|
||||||
/*
|
|
||||||
* Vencord, a Discord client mod
|
|
||||||
* Copyright (c) 2024 Vendicated and contributors
|
|
||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { Devs } from "@utils/constants";
|
|
||||||
import { proxyLazy } from "@utils/lazy";
|
|
||||||
import definePlugin from "@utils/types";
|
|
||||||
import { findByPropsLazy } from "@webpack";
|
|
||||||
import { Forms, useEffect, useRef } from "@webpack/common";
|
|
||||||
import type { StoreApi, UseBoundStore } from "zustand";
|
|
||||||
|
|
||||||
type Modal = {
|
|
||||||
Layer?: any,
|
|
||||||
instant?: boolean,
|
|
||||||
backdropStyle?: "SUBTLE" | "DARK" | "BLUR", "IMMERSIVE",
|
|
||||||
};
|
|
||||||
|
|
||||||
const { useModalContext, useModalsStore } = proxyLazy(() => Forms as any as {
|
|
||||||
useModalContext(): "default" | "popout";
|
|
||||||
useModalsStore: UseBoundStore<StoreApi<{
|
|
||||||
default: Modal[];
|
|
||||||
popout: Modal[];
|
|
||||||
}>>,
|
|
||||||
});
|
|
||||||
|
|
||||||
const { animated, useSpring, useTransition } = findByPropsLazy("a", "animated", "useTransition");
|
|
||||||
|
|
||||||
const ANIMS = {
|
|
||||||
SUBTLE: {
|
|
||||||
off: { opacity: 1 },
|
|
||||||
on: { opacity: 0.9 },
|
|
||||||
},
|
|
||||||
DARK: {
|
|
||||||
off: { opacity: 1 },
|
|
||||||
on: { opacity: 0.7 },
|
|
||||||
},
|
|
||||||
BLUR: {
|
|
||||||
off: { opacity: 1, filter: "blur(0px)" },
|
|
||||||
on: { opacity: 0.7, filter: "blur(8px)" },
|
|
||||||
},
|
|
||||||
IMMERSIVE: {
|
|
||||||
off: { opacity: 1 },
|
|
||||||
on: { opacity: 0.7 }
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export default definePlugin({
|
|
||||||
name: "ModalFade",
|
|
||||||
description: "Makes modals fade the backdrop, rather than dimming",
|
|
||||||
authors: [Devs.Kyuuhachi],
|
|
||||||
|
|
||||||
patches: [
|
|
||||||
{
|
|
||||||
find: "contextMenuCallbackNative,!1",
|
|
||||||
replacement: {
|
|
||||||
match: /(?<=\()"div"(?=,\{className:\i\(\)\(\i\?\i\.mobileApp:\i.app\))/,
|
|
||||||
replace: "$self.MainWrapper",
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
find: ".SUBTLE=\"SUBTLE\"",
|
|
||||||
replacement: {
|
|
||||||
match: /\(0,\i\.useTransition\)*/,
|
|
||||||
replace: "$self.nullTransition"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
|
|
||||||
nullTransition(value: any, args: object) {
|
|
||||||
return useTransition(value, {
|
|
||||||
...args,
|
|
||||||
from: {},
|
|
||||||
enter: { _: 0 }, // Spring gets unhappy if there's zero animations
|
|
||||||
leave: {},
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
MainWrapper(props: object) {
|
|
||||||
const context = useModalContext();
|
|
||||||
const modals = useModalsStore(modals => modals[context] ?? []);
|
|
||||||
const modal = modals.findLast(modal => modal.Layer == null); // || modal.Layer === AppLayer
|
|
||||||
const anim = ANIMS[modal?.backdropStyle ?? "DARK"];
|
|
||||||
const isInstant = modal?.instant;
|
|
||||||
const prevIsInstant = usePrevious(isInstant);
|
|
||||||
const style = useSpring({
|
|
||||||
config: { duration: isInstant || prevIsInstant ? 0 : 300 },
|
|
||||||
...modal != null ? anim.on : anim.off,
|
|
||||||
});
|
|
||||||
return <animated.div style={style} {...props} />;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
function usePrevious<T>(value: T | undefined): T | undefined {
|
|
||||||
const ref = useRef<T>(undefined);
|
|
||||||
useEffect(() => {
|
|
||||||
if (ref !== undefined) {
|
|
||||||
ref.current = value;
|
|
||||||
}
|
|
||||||
}, [value]);
|
|
||||||
return ref.current;
|
|
||||||
}
|
|
|
@ -171,7 +171,7 @@ export default definePlugin({
|
||||||
{
|
{
|
||||||
find: "#{intl::CUSTOM_STATUS_SET_CUSTOM_STATUS}",
|
find: "#{intl::CUSTOM_STATUS_SET_CUSTOM_STATUS}",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /\.ModalFooter,.{0,70}\i\.\i\.string\(\i\.\i#{intl::SAVE}\)\}\)/,
|
match: /\.\i\i,children:.{0,70}\i\.\i\.string\(\i\.\i#{intl::SAVE}\)\}\)/,
|
||||||
replace: "$&,$self.renderRememberButton(this.state)"
|
replace: "$&,$self.renderRememberButton(this.state)"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -88,7 +88,7 @@ export default definePlugin({
|
||||||
find: "referencedUsernameProfile,referencedAvatarProfile",
|
find: "referencedUsernameProfile,referencedAvatarProfile",
|
||||||
replacement: [
|
replacement: [
|
||||||
{
|
{
|
||||||
match: /CUSTOM_GIFT.*?=(?=\(0,\i.jsx\)\(\i.FocusRing)/,
|
match: /CUSTOM_GIFT.*?=(?=\(0,\i.jsx\)\(\i.\i\i)/,
|
||||||
replace: "$&!$self.isReplyToBlocked(arguments[0].message)&&",
|
replace: "$&!$self.isReplyToBlocked(arguments[0].message)&&",
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
|
@ -212,8 +212,8 @@ export default definePlugin({
|
||||||
{
|
{
|
||||||
// Make muted channels also appear as unread if hide unreads is false and the channel is hidden
|
// Make muted channels also appear as unread if hide unreads is false and the channel is hidden
|
||||||
predicate: () => settings.store.channelStyle === ChannelStyle.MutedUnread || settings.store.channelStyle === ChannelStyle.Unread,
|
predicate: () => settings.store.channelStyle === ChannelStyle.MutedUnread || settings.store.channelStyle === ChannelStyle.Unread,
|
||||||
match: /\.LOCKED;if\((?<={channel:(\i).+?)/,
|
match: /(?<=\.LOCKED(?:;if\(|:))(?<={channel:(\i).+?)/,
|
||||||
replace: (m, channel) => `${m}!$self.isHiddenChannel(${channel})&&`
|
replace: (_, channel) => `!$self.isHiddenChannel(${channel})&&`
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue