Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix unwanted nametags paint tooltip #414

Merged
merged 18 commits into from
Apr 19, 2023
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG-nightly.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- Fixed an issue in the emote menu where the previously selected provider would close if a set was empty
- Fixed emote cards sometimes not showing who added the emote
- Fixed an issue where the detailed emote card would clip under existing chat messages
- Fixed unwanted nametag paint tooltip when nametag paints are disabled

### Version 3.0.5.1000

Expand Down
4 changes: 0 additions & 4 deletions src/directive/TextPaintDirective.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { Directive, DirectiveBinding } from "vue";
import { useConfig } from "@/composable/useSettings";

const ATTR_SEVENTV_PAINT_ID = "data-seventv-cosmetic-paint-id";
const ATTR_SEVENTV_TEXT = "data-seventv-painted-text";
Expand All @@ -18,9 +17,6 @@ export const TextPaintDirective = {
} as Directive<HTMLElement, string | null>;

function updateElementStyles(el: HTMLElement, paintID: string | null): void {
const shouldRender = useConfig("vanity.nametag_paints"); // TODO: better way to handle disable of paints
if (!shouldRender.value) return;

if (!paintID || (el.hasAttribute(ATTR_SEVENTV_PAINT_ID) && el.getAttribute(ATTR_SEVENTV_PAINT_ID) !== paintID)) {
el.style.backgroundImage = "";
el.style.filter = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import type { ChatUser } from "@/common/chat/ChatMessage";
import { useChannelContext } from "@/composable/channel/useChannelContext";
import { useChatProperties } from "@/composable/chat/useChatProperties";
import { useCosmetics } from "@/composable/useCosmetics";
import { useConfig } from "@/composable/useSettings";
import Badge from "./Badge.vue";

const props = defineProps<{
Expand All @@ -52,6 +53,7 @@ const emit = defineEmits<{
const ctx = useChannelContext();
const properties = useChatProperties(ctx);
const cosmetics = useCosmetics(props.user.id);
const shouldRenderPaint = useConfig("vanity.nametag_paints");
const twitchBadges = ref([] as Twitch.ChatBadge[]);

const paint = ref<SevenTV.Cosmetic<"PAINT"> | null>(null);
Expand Down Expand Up @@ -88,7 +90,7 @@ const stop = watch(
return;
}

paint.value = paints && paints.size ? paints.values().next().value : null;
paint.value = shouldRenderPaint.value && paints && paints.size ? paints.values().next().value : null;
activeBadges.value = [...badges.values()];
},
{ immediate: true },
Expand Down