You've already forked AstralRinth
forked from didirus/AstralRinth
fix: scopes i18n + authorization page temp warning (#4989)
This commit is contained in:
@@ -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',
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user