Compare commits

...
Author SHA1 Message Date
Calum H. (IMB11) ac8d216d1a fix: copy 2026-06-09 20:03:07 +01:00
Calum H. (IMB11) ef043ecce8 fix: lint 2026-06-09 19:42:05 +01:00
Calum H. (IMB11) 015741ea4d fix: banner + fallback text misaligned in db 2026-06-09 19:38:01 +01:00
2 changed files with 29 additions and 3 deletions
+11 -3
View File
@@ -61,6 +61,7 @@
{{
formatMessage(messages.discordRoleBannerBody, {
roles: eligibleDiscordRolesLabel,
count: eligibleDiscordRoles.length,
})
}}
</div>
@@ -162,7 +163,7 @@ const messages = defineMessages({
discordRoleBannerBody: {
id: 'dashboard.discord-roles.banner.body',
defaultMessage:
"You're eligible for {roles}. Link your Discord account through Modrinth and we'll sync them automatically.",
"You're eligible for the {roles} creator {count, plural, one {role} other {roles}} on Discord. Link your Discord account through Modrinth and we'll sync {count, plural, one {it} other {them}} automatically.",
},
discordRoleBannerCta: {
id: 'dashboard.discord-roles.banner.cta',
@@ -192,6 +193,10 @@ useSeoMeta({
const route = useNativeRoute()
const hasLinkedDiscordAccount = computed(
() => auth.value.user?.auth_providers?.includes('discord') === true,
)
const { data: projects } = useQuery({
queryKey: computed(() => ['dashboard-discord-role-eligibility', auth.value.user?.id, 'projects']),
queryFn: () => {
@@ -200,7 +205,7 @@ const { data: projects } = useQuery({
return client.labrinth.users_v2.getProjects(userId)
},
enabled: computed(() => !!auth.value.user?.id),
enabled: computed(() => !!auth.value.user?.id && !hasLinkedDiscordAccount.value),
})
const totalProjectDownloads = computed(() =>
@@ -238,7 +243,10 @@ const hasDismissedDiscordRoleBanner = computed(() =>
dismissedDiscordRoleBannerUsers.value.includes(auth.value.user?.id ?? ''),
)
const showDiscordRoleBanner = computed(
() => eligibleDiscordRoles.value.length > 0 && !hasDismissedDiscordRoleBanner.value,
() =>
eligibleDiscordRoles.value.length > 0 &&
!hasLinkedDiscordAccount.value &&
!hasDismissedDiscordRoleBanner.value,
)
function dismissDiscordRoleBanner() {
@@ -0,0 +1,18 @@
UPDATE notifications_templates
SET plaintext_fallback = CONCAT(
'Hey {user.name}!',
CHR(10),
CHR(10),
'Your projects just passed 20,000 total downloads, nice!',
CHR(10),
CHR(10),
'We want to invite you to Modrinth''s Creator Club, a space in our discord where you can chat with other creators, share feedback with us, and stay plugged in.',
CHR(10),
CHR(10),
'To join just link your Discord account through Modrinth and we''ll grant access automatically!',
CHR(10),
CHR(10),
'Join the Creator Club: {discord.link_url}'
)
WHERE channel = 'email'
AND notification_type = 'discord_role_creator_club';