fix: scopes i18n + authorization page temp warning (#4989)

This commit is contained in:
Calum H.
2025-12-29 19:49:54 +00:00
committed by GitHub
parent 042451bad6
commit 3e246f12de
2 changed files with 19 additions and 9 deletions

View File

@@ -1,3 +1,5 @@
import { defineMessages, useVIntl } from '@modrinth/ui'
export const scopeMessages = defineMessages({ export const scopeMessages = defineMessages({
userReadEmailLabel: { userReadEmailLabel: {
id: 'scopes.userReadEmail.label', id: 'scopes.userReadEmail.label',

View File

@@ -13,7 +13,8 @@
account. You can manage and review access to your account here at any time. account. You can manage and review access to your account here at any time.
</p> </p>
<div v-if="appInfoLookup.length === 0" class="universal-card recessed"> <div v-if="appInfoLookup.length === 0" class="universal-card recessed">
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!
</div> </div>
<div <div
v-for="authorization in appInfoLookup" v-for="authorization in appInfoLookup"
@@ -123,13 +124,15 @@ const { data: usersApps, refresh } = await useAsyncData('userAuthorizations', ()
const { data: appInformation } = await useAsyncData( const { data: appInformation } = await useAsyncData(
'appInfo', 'appInfo',
() => () => {
useBaseFetch('oauth/apps', { if (!usersApps.value?.length) return null
return useBaseFetch('oauth/apps', {
internal: true, internal: true,
query: { query: {
ids: usersApps.value.map((c) => c.app_id).join(','), ids: JSON.stringify(usersApps.value.map((c) => c.app_id)),
}, },
}), })
},
{ {
watch: usersApps, watch: usersApps,
}, },
@@ -137,21 +140,26 @@ const { data: appInformation } = await useAsyncData(
const { data: appCreatorsInformation } = await useAsyncData( const { data: appCreatorsInformation } = await useAsyncData(
'appCreatorsInfo', 'appCreatorsInfo',
() => () => {
useBaseFetch('users', { if (!appInformation.value?.length) return null
return useBaseFetch('users', {
query: { query: {
ids: JSON.stringify(appInformation.value.map((c) => c.created_by)), ids: JSON.stringify(appInformation.value.map((c) => c.created_by)),
}, },
}), })
},
{ {
watch: appInformation, watch: appInformation,
}, },
) )
const appInfoLookup = computed(() => { const appInfoLookup = computed(() => {
if (!usersApps.value || !appInformation.value || !appCreatorsInformation.value) {
return []
}
return usersApps.value.map((app) => { return usersApps.value.map((app) => {
const info = appInformation.value.find((c) => c.id === app.app_id) 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 { return {
...app, ...app,
app: info || null, app: info || null,