Skip to content

Commit

Permalink
Fix: fixed mentions not being clickable when colored mentions are tur…
Browse files Browse the repository at this point in the history
…ned off (#1088)
  • Loading branch information
ChrisScr3ams authored Oct 2, 2024
1 parent d0b2e0a commit 9538e2c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 20 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-nightly.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- Fixed some settings on kick
- Added more drop shadow settings
- Added link to creators 7TV profile to emote cards of 7TV emotes
- Fixed mentions not being clickable when colred mentions are turned off

### 3.1.2.1000

Expand Down
32 changes: 14 additions & 18 deletions src/app/chat/MessageTokenMention.vue
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
<template>
<span class="mention-token">
<span v-if="shouldRenderColoredMentions" :style="{ color: token.content.user?.color }">
<UserTag
:user="
token.content.user ?? {
id: uuid(),
username: tag.toLowerCase(),
displayName: tag,
color: '',
}
"
:as-mention="asMention"
:hide-badges="true"
/>
</span>
<span v-else>
{{ token.content.displayText }}
</span>
<UserTag
:user="
token.content.user ?? {
id: uuid(),
username: tag.toLowerCase(),
displayName: tag,
color: '',
}
"
:as-mention="asMention"
:hide-badges="true"
:style="shouldRenderColoredMentions ? { color: token.content.user?.color } : null"
/>
</span>
</template>
Expand All @@ -31,7 +27,7 @@ const props = defineProps<{
msg?: ChatMessage;
}>();
const shouldRenderColoredMentions = useConfig("chat.colored_mentions");
const shouldRenderColoredMentions = useConfig<boolean>("chat.colored_mentions");
const asMention = props.token.content.displayText.charAt(0) === "@";
const tag = asMention ? props.token.content.displayText.slice(1) : props.token.content.displayText;
Expand Down
11 changes: 9 additions & 2 deletions src/app/chat/UserTag.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,17 @@
<!-- Message Author -->
<span
v-tooltip="paint && paint.data ? `Paint: ${paint.data.name}` : ''"
v-tooltip="
paint && paint.data && !(asMention && !shouldRenderColoredMentions) ? `Paint: ${paint.data.name}` : ''
"
class="seventv-chat-user-username"
@click="handleClick($event)"
>
<span v-cosmetic-paint="shouldRenderPaint && paint ? paint.id : null">
<span
v-cosmetic-paint="
shouldRenderPaint && !(asMention && !shouldRenderColoredMentions) && paint ? paint.id : null
"
>
<span v-if="asMention">@</span>
<span>{{ user.displayName }}</span>
<span v-if="user.intl"> ({{ user.username }})</span>
Expand Down Expand Up @@ -101,6 +107,7 @@ const shouldRender7tvBadges = useConfig("vanity.7tv_Badges");
const betterUserCardEnabled = useConfig("chat.user_card");
const twitchBadges = ref<Twitch.ChatBadge[]>([]);
const twitchBadgeSets = toRef(properties, "twitchBadgeSets");
const shouldRenderColoredMentions = useConfig("chat.colored_mentions");
const tagRef = ref<HTMLDivElement>();
const showUserCard = ref(false);
Expand Down

0 comments on commit 9538e2c

Please sign in to comment.