mirror of
https://github.com/Equicord/Equicord.git
synced 2025-02-15 17:14:04 -05:00
Remove Extra Patch From MGDMs
This commit is contained in:
parent
6dd85a104b
commit
be0225bcad
1 changed files with 2 additions and 12 deletions
|
@ -19,10 +19,9 @@
|
||||||
import ErrorBoundary from "@components/ErrorBoundary";
|
import ErrorBoundary from "@components/ErrorBoundary";
|
||||||
import { Devs } from "@utils/constants";
|
import { Devs } from "@utils/constants";
|
||||||
import { isNonNullish } from "@utils/guards";
|
import { isNonNullish } from "@utils/guards";
|
||||||
import { pluralise } from "@utils/misc";
|
|
||||||
import definePlugin from "@utils/types";
|
import definePlugin from "@utils/types";
|
||||||
import { findByPropsLazy } from "@webpack";
|
import { findByPropsLazy } from "@webpack";
|
||||||
import { Avatar, ChannelStore, Clickable, IconUtils, RelationshipStore, ScrollerThin, UserStore, useStateFromStores } from "@webpack/common";
|
import { Avatar, ChannelStore, Clickable, IconUtils, RelationshipStore, ScrollerThin, UserStore } from "@webpack/common";
|
||||||
import { Channel, User } from "discord-types/general";
|
import { Channel, User } from "discord-types/general";
|
||||||
|
|
||||||
const SelectedChannelActionCreators = findByPropsLazy("selectPrivateChannel");
|
const SelectedChannelActionCreators = findByPropsLazy("selectPrivateChannel");
|
||||||
|
@ -64,13 +63,9 @@ export default definePlugin({
|
||||||
find: "Messages.USER_PROFILE_MUTUAL_GUILDS_PLACEHOLDER).with",
|
find: "Messages.USER_PROFILE_MUTUAL_GUILDS_PLACEHOLDER).with",
|
||||||
group: true,
|
group: true,
|
||||||
replacement: [
|
replacement: [
|
||||||
{
|
|
||||||
match: /(?<=let\{user:(\i),.{0,700})(?=return\(null!=)/,
|
|
||||||
replace: "let vencordMutualGroupsCount=$self.useGDMCount($1.id);"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
match: /(?<=(\i\.push)\(\{section:\i\.UserProfileSections\.MUTUAL_GUILDS,text:.{0,250}\}\)\)\}\))/,
|
match: /(?<=(\i\.push)\(\{section:\i\.UserProfileSections\.MUTUAL_GUILDS,text:.{0,250}\}\)\)\}\))/,
|
||||||
replace: ',$1({section:"MUTUAL_GDMS",text:vencordMutualGroupsCount})'
|
replace: ',$1({section:"MUTUAL_GDMS",text:"Mutual Groups"})'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
match: /(?<=(\i)===\i\.UserProfileSections\.MUTUAL_GUILDS?.{0,150}\}\):)/,
|
match: /(?<=(\i)===\i\.UserProfileSections\.MUTUAL_GUILDS?.{0,150}\}\):)/,
|
||||||
|
@ -80,11 +75,6 @@ export default definePlugin({
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
useGDMCount(userId: string) {
|
|
||||||
const state = useStateFromStores([ChannelStore], () => ChannelStore.getSortedPrivateChannels().filter(c => c.isGroupDM() && c.recipients.includes(userId))).length;
|
|
||||||
const label = "Mutual Group";
|
|
||||||
return state > 0 ? pluralise(state, label) : `No ${label}s`;
|
|
||||||
},
|
|
||||||
renderMutualGDMs: ErrorBoundary.wrap(({ user, onClose }: { user: User, onClose: () => void; }) => {
|
renderMutualGDMs: ErrorBoundary.wrap(({ user, onClose }: { user: User, onClose: () => void; }) => {
|
||||||
const entries = ChannelStore.getSortedPrivateChannels().filter(c => c.isGroupDM() && c.recipients.includes(user.id)).map(c => (
|
const entries = ChannelStore.getSortedPrivateChannels().filter(c => c.isGroupDM() && c.recipients.includes(user.id)).map(c => (
|
||||||
<Clickable
|
<Clickable
|
||||||
|
|
Loading…
Reference in a new issue