From 3e246f12de5d86da90a342103a8a56f6a7551ba5 Mon Sep 17 00:00:00 2001 From: "Calum H." Date: Mon, 29 Dec 2025 19:49:54 +0000 Subject: [PATCH] fix: scopes i18n + authorization page temp warning (#4989) --- apps/frontend/src/composables/auth/scopes.ts | 2 ++ .../src/pages/settings/authorizations.vue | 26 ++++++++++++------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/apps/frontend/src/composables/auth/scopes.ts b/apps/frontend/src/composables/auth/scopes.ts index 6db1dd9c..2999de9e 100644 --- a/apps/frontend/src/composables/auth/scopes.ts +++ b/apps/frontend/src/composables/auth/scopes.ts @@ -1,3 +1,5 @@ +import { defineMessages, useVIntl } from '@modrinth/ui' + export const scopeMessages = defineMessages({ userReadEmailLabel: { id: 'scopes.userReadEmail.label', diff --git a/apps/frontend/src/pages/settings/authorizations.vue b/apps/frontend/src/pages/settings/authorizations.vue index d1c89e0e..74fa5c55 100644 --- a/apps/frontend/src/pages/settings/authorizations.vue +++ b/apps/frontend/src/pages/settings/authorizations.vue @@ -13,7 +13,8 @@ account. You can manage and review access to your account here at any time.

- You have not authorized any applications. + We currently can't display your authorized apps, we're working to fix this. Please visit this + page at a later date!
- useBaseFetch('oauth/apps', { + () => { + if (!usersApps.value?.length) return null + return useBaseFetch('oauth/apps', { internal: true, query: { - ids: usersApps.value.map((c) => c.app_id).join(','), + ids: JSON.stringify(usersApps.value.map((c) => c.app_id)), }, - }), + }) + }, { watch: usersApps, }, @@ -137,21 +140,26 @@ const { data: appInformation } = await useAsyncData( const { data: appCreatorsInformation } = await useAsyncData( 'appCreatorsInfo', - () => - useBaseFetch('users', { + () => { + if (!appInformation.value?.length) return null + return useBaseFetch('users', { query: { ids: JSON.stringify(appInformation.value.map((c) => c.created_by)), }, - }), + }) + }, { watch: appInformation, }, ) const appInfoLookup = computed(() => { + if (!usersApps.value || !appInformation.value || !appCreatorsInformation.value) { + return [] + } return usersApps.value.map((app) => { const info = appInformation.value.find((c) => c.id === app.app_id) - const owner = appCreatorsInformation.value.find((c) => c.id === info.created_by) + const owner = appCreatorsInformation.value.find((c) => c.id === info?.created_by) return { ...app, app: info || null,