mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-01-10 01:46:23 +00:00
Merge branch 'dev' into immediate-finds
This commit is contained in:
commit
5ba21bdf36
2 changed files with 4 additions and 3 deletions
|
@ -131,13 +131,14 @@ function VoiceChannelTooltip({ channel, isLocked }: VoiceChannelTooltipProps) {
|
||||||
interface VoiceChannelIndicatorProps {
|
interface VoiceChannelIndicatorProps {
|
||||||
userId: string;
|
userId: string;
|
||||||
isMessageIndicator?: boolean;
|
isMessageIndicator?: boolean;
|
||||||
|
isProfile?: boolean;
|
||||||
isActionButton?: boolean;
|
isActionButton?: boolean;
|
||||||
shouldHighlight?: boolean;
|
shouldHighlight?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const clickTimers = {} as Record<string, any>;
|
const clickTimers = {} as Record<string, any>;
|
||||||
|
|
||||||
export const VoiceChannelIndicator = ErrorBoundary.wrap(({ userId, isActionButton, isMessageIndicator, shouldHighlight }: VoiceChannelIndicatorProps) => {
|
export const VoiceChannelIndicator = ErrorBoundary.wrap(({ userId, isMessageIndicator, isProfile, isActionButton, shouldHighlight }: VoiceChannelIndicatorProps) => {
|
||||||
const channelId = useStateFromStores([VoiceStateStore], () => VoiceStateStore.getVoiceStateForUser(userId)?.channelId as string | undefined);
|
const channelId = useStateFromStores([VoiceStateStore], () => VoiceStateStore.getVoiceStateForUser(userId)?.channelId as string | undefined);
|
||||||
|
|
||||||
const channel = channelId == null ? undefined : ChannelStore.getChannel(channelId);
|
const channel = channelId == null ? undefined : ChannelStore.getChannel(channelId);
|
||||||
|
@ -184,7 +185,7 @@ export const VoiceChannelIndicator = ErrorBoundary.wrap(({ userId, isActionButto
|
||||||
{props => {
|
{props => {
|
||||||
const iconProps: IconProps = {
|
const iconProps: IconProps = {
|
||||||
...props,
|
...props,
|
||||||
className: classes(isMessageIndicator && cl("message-indicator"), !isActionButton && cl("speaker-margin"), isActionButton && ActionButtonClasses.actionButton, shouldHighlight && ActionButtonClasses.highlight),
|
className: classes(isMessageIndicator && cl("message-indicator"), (!isProfile && !isActionButton) && cl("speaker-margin"), isActionButton && ActionButtonClasses.actionButton, shouldHighlight && ActionButtonClasses.highlight),
|
||||||
size: isActionButton ? 20 : undefined,
|
size: isActionButton ? 20 : undefined,
|
||||||
onClick
|
onClick
|
||||||
};
|
};
|
||||||
|
|
|
@ -59,7 +59,7 @@ export default definePlugin({
|
||||||
find: ".Messages.USER_PROFILE_LOAD_ERROR",
|
find: ".Messages.USER_PROFILE_LOAD_ERROR",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /(\.fetchError.+?\?)null/,
|
match: /(\.fetchError.+?\?)null/,
|
||||||
replace: (_, rest) => `${rest}$self.VoiceChannelIndicator({userId:arguments[0]?.userId})`
|
replace: (_, rest) => `${rest}$self.VoiceChannelIndicator({userId:arguments[0]?.userId,isProfile:true})`
|
||||||
},
|
},
|
||||||
predicate: () => settings.store.showInUserProfileModal
|
predicate: () => settings.store.showInUserProfileModal
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue