From 015741ea4dbce4d2837c410b933a59c77d2cc001 Mon Sep 17 00:00:00 2001 From: "Calum H. (IMB11)" Date: Tue, 9 Jun 2026 19:38:01 +0100 Subject: [PATCH 1/3] fix: banner + fallback text misaligned in db --- apps/frontend/src/pages/dashboard.vue | 11 +++++++++-- ...3000_update-discord-role-email-fallback.sql | 18 ++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 apps/labrinth/migrations/20260609193000_update-discord-role-email-fallback.sql diff --git a/apps/frontend/src/pages/dashboard.vue b/apps/frontend/src/pages/dashboard.vue index 2a82c1ab89..630959d75a 100644 --- a/apps/frontend/src/pages/dashboard.vue +++ b/apps/frontend/src/pages/dashboard.vue @@ -192,6 +192,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 +204,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 +242,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() { diff --git a/apps/labrinth/migrations/20260609193000_update-discord-role-email-fallback.sql b/apps/labrinth/migrations/20260609193000_update-discord-role-email-fallback.sql new file mode 100644 index 0000000000..cdb1435696 --- /dev/null +++ b/apps/labrinth/migrations/20260609193000_update-discord-role-email-fallback.sql @@ -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'; From ef043ecce8ce56302ad2f38c74bdce0b72761c6f Mon Sep 17 00:00:00 2001 From: "Calum H. (IMB11)" Date: Tue, 9 Jun 2026 19:42:05 +0100 Subject: [PATCH 2/3] fix: lint --- apps/frontend/src/pages/dashboard.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/frontend/src/pages/dashboard.vue b/apps/frontend/src/pages/dashboard.vue index 630959d75a..02433535a2 100644 --- a/apps/frontend/src/pages/dashboard.vue +++ b/apps/frontend/src/pages/dashboard.vue @@ -192,8 +192,8 @@ useSeoMeta({ const route = useNativeRoute() -const hasLinkedDiscordAccount = computed(() => - auth.value.user?.auth_providers?.includes('discord') === true, +const hasLinkedDiscordAccount = computed( + () => auth.value.user?.auth_providers?.includes('discord') === true, ) const { data: projects } = useQuery({ From ac8d216d1a2708fde6be03606040e5bbcc636e8e Mon Sep 17 00:00:00 2001 From: "Calum H. (IMB11)" Date: Tue, 9 Jun 2026 20:03:07 +0100 Subject: [PATCH 3/3] fix: copy --- apps/frontend/src/pages/dashboard.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/frontend/src/pages/dashboard.vue b/apps/frontend/src/pages/dashboard.vue index 02433535a2..03db7bedbd 100644 --- a/apps/frontend/src/pages/dashboard.vue +++ b/apps/frontend/src/pages/dashboard.vue @@ -61,6 +61,7 @@ {{ formatMessage(messages.discordRoleBannerBody, { roles: eligibleDiscordRolesLabel, + count: eligibleDiscordRoles.length, }) }} @@ -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',