Remove obsolete patches for old profiles (#2800)
Co-authored-by: Nuckyz <61953774+Nuckyz@users.noreply.github.com>
This commit is contained in:
parent
2bdc2f4e82
commit
44c8463496
13 changed files with 23 additions and 291 deletions
|
|
@ -18,12 +18,11 @@
|
|||
|
||||
import "./VoiceChannelSection.css";
|
||||
|
||||
import { findByCodeLazy, findByPropsLazy } from "@webpack";
|
||||
import { findByPropsLazy } from "@webpack";
|
||||
import { Button, Forms, PermissionStore, Toasts } from "@webpack/common";
|
||||
import { Channel } from "discord-types/general";
|
||||
|
||||
const ChannelActions = findByPropsLazy("selectChannel", "selectVoiceChannel");
|
||||
const UserPopoutSection = findByCodeLazy(".lastSection", "children:");
|
||||
|
||||
const CONNECT = 1n << 20n;
|
||||
|
||||
|
|
@ -34,7 +33,8 @@ interface VoiceChannelFieldProps {
|
|||
}
|
||||
|
||||
export const VoiceChannelSection = ({ channel, label, showHeader }: VoiceChannelFieldProps) => (
|
||||
<UserPopoutSection>
|
||||
// @TODO The div is supposed to be a UserPopoutSection
|
||||
<div>
|
||||
{showHeader && <Forms.FormTitle className="vc-uvs-header">In a voice channel</Forms.FormTitle>}
|
||||
<Button
|
||||
className="vc-uvs-button"
|
||||
|
|
@ -57,5 +57,5 @@ export const VoiceChannelSection = ({ channel, label, showHeader }: VoiceChannel
|
|||
>
|
||||
{label}
|
||||
</Button>
|
||||
</UserPopoutSection>
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ export default definePlugin({
|
|||
);
|
||||
},
|
||||
|
||||
patchPopout: ({ user }: UserProps) => {
|
||||
patchProfilePopout: ({ user }: UserProps) => {
|
||||
const isSelfUser = user.id === UserStore.getCurrentUser().id;
|
||||
return (
|
||||
<div className={isSelfUser ? "vc-uvs-popout-margin-self" : ""}>
|
||||
|
|
@ -94,21 +94,7 @@ export default definePlugin({
|
|||
},
|
||||
|
||||
patches: [
|
||||
// above message box
|
||||
{
|
||||
find: ".popularApplicationCommandIds,",
|
||||
replacement: {
|
||||
match: /(?<=,)(?=!\i&&!\i&&.{0,50}setNote:)/,
|
||||
replace: "$self.patchPopout(arguments[0]),",
|
||||
}
|
||||
},
|
||||
// below username
|
||||
{
|
||||
find: ".Messages.MUTUAL_GUILDS_WITH_END_COUNT", // Lazy-loaded
|
||||
replacement: {
|
||||
match: /\.body.+?displayProfile:\i}\),/,
|
||||
replace: "$&$self.patchModal(arguments[0]),",
|
||||
}
|
||||
}
|
||||
// @TODO Maybe patch UserVoiceShow in simplified profile popout
|
||||
// @TODO Patch new profile modal
|
||||
],
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue