UserVoiceShow: fix showing in wrong location (#3884)

Co-authored-by: V <vendicated@riseup.net>
This commit is contained in:
u32 2026-01-09 22:11:34 +00:00 committed by GitHub
parent 58815b642e
commit 353a699481
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 8 deletions

View file

@ -25,14 +25,12 @@ const ActionButtonClasses = findByPropsLazy("actionButton", "highlight");
type IconProps = Omit<React.ComponentPropsWithoutRef<"div">, "children"> & {
size?: number;
iconClassName?: string;
};
function Icon(props: PropsWithChildren<IconProps>) {
const {
size = 16,
className,
iconClassName,
...restProps
} = props;
@ -42,7 +40,6 @@ function Icon(props: PropsWithChildren<IconProps>) {
className={classes(cl("speaker"), className)}
>
<svg
className={iconClassName}
width={size}
height={size}
viewBox="0 0 24 24"
@ -192,8 +189,12 @@ export const VoiceChannelIndicator = ErrorBoundary.wrap(({ userId, isProfile, is
{...props}
role="button"
onClick={onClick}
className={classes(cl("clickable"), isActionButton && ActionButtonClasses.actionButton, isActionButton && shouldHighlight && ActionButtonClasses.highlight)}
iconClassName={classes(cl(isProfile && "profile-speaker"))}
className={classes(
cl("clickable"),
isActionButton && ActionButtonClasses.actionButton,
isActionButton && shouldHighlight && ActionButtonClasses.highlight,
cl(isProfile && "profile-speaker")
)}
size={isActionButton ? 20 : 16}
/>
)}

View file

@ -57,10 +57,10 @@ export default definePlugin({
patches: [
// User Popout, User Profile Modal, Direct Messages Side Profile
{
find: "#{intl::USER_PROFILE_LOAD_ERROR}",
find: "#{intl::USER_PROFILE_PRONOUNS}",
replacement: {
match: /(\.fetchError.+?\?)null/,
replace: (_, rest) => `${rest}$self.VoiceChannelIndicator({userId:arguments[0]?.userId,isProfile:true})`
match: /(\i).isVerifiedBot\(\)}\),/,
replace: "$&$self.VoiceChannelIndicator({userId:$1.id,isProfile:true}),"
},
predicate: () => settings.store.showInUserProfileModal
},