mirror of
https://github.com/Equicord/Equicord.git
synced 2025-01-31 03:33:36 -05:00
Merge remote-tracking branch 'upstream/dev' into dev
This commit is contained in:
commit
c2262533d3
4 changed files with 10 additions and 10 deletions
|
@ -16,7 +16,7 @@ import { User } from "discord-types/general";
|
||||||
interface UserProfileProps {
|
interface UserProfileProps {
|
||||||
popoutProps: Record<string, any>;
|
popoutProps: Record<string, any>;
|
||||||
currentUser: User;
|
currentUser: User;
|
||||||
OriginalPopout: () => React.ReactNode;
|
originalRenderPopout: () => React.ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
const UserProfile = findComponentByCodeLazy("UserProfilePopoutWrapper: user cannot be undefined");
|
const UserProfile = findComponentByCodeLazy("UserProfilePopoutWrapper: user cannot be undefined");
|
||||||
|
@ -78,7 +78,7 @@ export default definePlugin({
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
match: /(\.AVATAR,children:.+?renderPopout:(\i)=>){(.+?)}(?=,position)(?<=currentUser:(\i).+?)/,
|
match: /(\.AVATAR,children:.+?renderPopout:(\i)=>){(.+?)}(?=,position)(?<=currentUser:(\i).+?)/,
|
||||||
replace: (_, rest, popoutProps, originalPopout, currentUser) => `${rest}$self.UserProfile({popoutProps:${popoutProps},currentUser:${currentUser},OriginalPopout:()=>{${originalPopout}}})`
|
replace: (_, rest, popoutProps, originalPopout, currentUser) => `${rest}$self.UserProfile({popoutProps:${popoutProps},currentUser:${currentUser},originalRenderPopout:()=>{${originalPopout}}})`
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
match: /\.AVATAR,children:.+?(?=renderPopout:)/,
|
match: /\.AVATAR,children:.+?(?=renderPopout:)/,
|
||||||
|
@ -112,17 +112,17 @@ export default definePlugin({
|
||||||
openAlternatePopout = false;
|
openAlternatePopout = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
UserProfile: ErrorBoundary.wrap(({ popoutProps, currentUser, OriginalPopout }: UserProfileProps) => {
|
UserProfile: ErrorBoundary.wrap(({ popoutProps, currentUser, originalRenderPopout }: UserProfileProps) => {
|
||||||
if (
|
if (
|
||||||
(settings.store.prioritizeServerProfile && openAlternatePopout) ||
|
(settings.store.prioritizeServerProfile && openAlternatePopout) ||
|
||||||
(!settings.store.prioritizeServerProfile && !openAlternatePopout)
|
(!settings.store.prioritizeServerProfile && !openAlternatePopout)
|
||||||
) {
|
) {
|
||||||
return <OriginalPopout />;
|
return originalRenderPopout();
|
||||||
}
|
}
|
||||||
|
|
||||||
const currentChannel = getCurrentChannel();
|
const currentChannel = getCurrentChannel();
|
||||||
if (currentChannel?.getGuildId() == null) {
|
if (currentChannel?.getGuildId() == null) {
|
||||||
return <OriginalPopout />;
|
return originalRenderPopout();
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -27,7 +27,7 @@ export default definePlugin({
|
||||||
{
|
{
|
||||||
find: '"ChannelAttachButton"',
|
find: '"ChannelAttachButton"',
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /\.attachButtonInner,"aria-label":.{0,50},onDoubleClick:(.+?:void 0),\.\.\.(\i),/,
|
match: /\.attachButtonInner,"aria-label":.{0,50},onDoubleClick:(.+?:void 0),.{0,30}?\.\.\.(\i),/,
|
||||||
replace: "$&onClick:$1,onContextMenu:$2.onClick,",
|
replace: "$&onClick:$1,onContextMenu:$2.onClick,",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -13,7 +13,7 @@ export default definePlugin({
|
||||||
authors: [Devs.Nuckyz],
|
authors: [Devs.Nuckyz],
|
||||||
patches: [
|
patches: [
|
||||||
{
|
{
|
||||||
find: "getFormatQuality(){",
|
find: ".handleImageLoad)",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /(?<=null;return )\i\.\i&&\(\i\|\|!\i\.isAnimated.+?:(?=\i&&\(\i="png"\))/,
|
match: /(?<=null;return )\i\.\i&&\(\i\|\|!\i\.isAnimated.+?:(?=\i&&\(\i="png"\))/,
|
||||||
replace: ""
|
replace: ""
|
||||||
|
|
|
@ -16,7 +16,7 @@ interface UserMentionComponentProps {
|
||||||
id: string;
|
id: string;
|
||||||
channelId: string;
|
channelId: string;
|
||||||
guildId: string;
|
guildId: string;
|
||||||
OriginalComponent: () => ReactNode;
|
originalComponent: () => ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default definePlugin({
|
export default definePlugin({
|
||||||
|
@ -29,7 +29,7 @@ export default definePlugin({
|
||||||
find: ':"text":',
|
find: ':"text":',
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /(hidePersonalInformation\).+?)(if\(null!=\i\){.+?return \i)(?=})/,
|
match: /(hidePersonalInformation\).+?)(if\(null!=\i\){.+?return \i)(?=})/,
|
||||||
replace: "$1return $self.UserMentionComponent({...arguments[0],OriginalComponent:()=>{$2}});"
|
replace: "$1return $self.UserMentionComponent({...arguments[0],originalComponent:()=>{$2}});"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -42,6 +42,6 @@ export default definePlugin({
|
||||||
channelId={props.channelId}
|
channelId={props.channelId}
|
||||||
/>
|
/>
|
||||||
), {
|
), {
|
||||||
fallback: ({ wrappedProps: { OriginalComponent } }) => <OriginalComponent />
|
fallback: ({ wrappedProps: { originalComponent } }) => originalComponent()
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue