@@ -10,9 +23,7 @@
@@ -25,9 +36,17 @@
@@ -43,7 +62,10 @@ import {
ButtonStyled,
commonMessages,
OverflowMenu,
- CollectionHeader, CollectionSidebarCurator, CollectionSidebarDescription, CollectionSidebarDetails
+ CollectionHeader,
+ CollectionSidebarCurator,
+ CollectionSidebarDescription,
+ CollectionSidebarDetails,
} from '@modrinth/ui'
import { ClipboardCopyIcon, MoreVerticalIcon } from '@modrinth/assets'
import { useVIntl } from '@vintl/vintl'
@@ -64,14 +86,18 @@ const curator: Ref
= ref(null)
const projects: Ref = ref([])
async function fetchCollection() {
- collection.value = await useFetch(`https://api.modrinth.com/v3/collection/${route.params.id}`).catch(handleError)
+ collection.value = await useFetch(
+ `https://api.modrinth.com/v3/collection/${route.params.id}`,
+ ).catch(handleError)
if (!collection.value) {
- return;
+ return
}
- [ projects.value, curator.value ] = await Promise.all([
- useFetch(`https://api.modrinth.com/v2/projects?ids=${encodeURIComponent(JSON.stringify(collection.value.projects))}`),
+ ;[projects.value, curator.value] = await Promise.all([
+ useFetch(
+ `https://api.modrinth.com/v2/projects?ids=${encodeURIComponent(JSON.stringify(collection.value.projects))}`,
+ ),
useFetch(`https://api.modrinth.com/v2/user/${collection.value.user}`).catch(handleError),
])
@@ -94,10 +120,9 @@ watch(
const themeStore = useTheming()
-
async function copyId() {
if (collection.value) {
- await navigator.clipboard.writeText(String(collection.value.id));
+ await navigator.clipboard.writeText(String(collection.value.id))
}
}
diff --git a/apps/app-frontend/src/pages/instance/Mods.vue b/apps/app-frontend/src/pages/instance/Mods.vue
index 0ca32d458..3e38981c3 100644
--- a/apps/app-frontend/src/pages/instance/Mods.vue
+++ b/apps/app-frontend/src/pages/instance/Mods.vue
@@ -69,7 +69,10 @@
name: x.author.name,
type: x.author.type,
id: x.author.slug,
- link: { path: `/${x.author.type}/${x.author.slug}`, query: { i: props.instance.path } },
+ link: {
+ path: `/${x.author.type}/${x.author.slug}`,
+ query: { i: props.instance.path },
+ },
linkProps: { target: '_blank' },
}
}
diff --git a/apps/app-frontend/src/pages/organization/Index.vue b/apps/app-frontend/src/pages/organization/Index.vue
index 6842ee958..7b607740b 100644
--- a/apps/app-frontend/src/pages/organization/Index.vue
+++ b/apps/app-frontend/src/pages/organization/Index.vue
@@ -1,16 +1,23 @@
-
+
-
+
@@ -23,9 +30,17 @@
@@ -41,9 +56,10 @@ import {
ButtonStyled,
commonMessages,
OverflowMenu,
- OrganizationHeader, OrganizationSidebarMembers
+ OrganizationHeader,
+ OrganizationSidebarMembers,
} from '@modrinth/ui'
-import { ClipboardCopyIcon, MoreVerticalIcon, DownloadIcon, HeartIcon, BookmarkIcon } from '@modrinth/assets'
+import { ClipboardCopyIcon, MoreVerticalIcon } from '@modrinth/assets'
import { useVIntl } from '@vintl/vintl'
import { useFetch } from '@/helpers/fetch'
import type { Project, Organization, ProjectV3, Environment } from '@modrinth/utils'
@@ -63,35 +79,41 @@ const projects: Ref = ref([])
const { instance, instanceContent, instanceQueryAppendage } = await useInstanceContext()
async function fetchOrganization() {
- organization.value = await useFetch(`https://api.modrinth.com/v3/organization/${route.params.id}`).catch(handleError)
- projects.value = (await useFetch(`https://api.modrinth.com/v3/organization/${route.params.id}/projects`).catch(handleError)).map((projectV3: ProjectV3) => {
+ organization.value = await useFetch(
+ `https://api.modrinth.com/v3/organization/${route.params.id}`,
+ ).catch(handleError)
+ projects.value = (
+ await useFetch(`https://api.modrinth.com/v3/organization/${route.params.id}/projects`).catch(
+ handleError,
+ )
+ ).map((projectV3: ProjectV3) => {
let type = projectV3.project_types[0]
if (type === 'plugin' || type === 'datapack') {
type = 'mod'
}
- let clientSide: Environment = 'unknown';
- let serverSide: Environment = 'unknown';
+ let clientSide: Environment = 'unknown'
+ let serverSide: Environment = 'unknown'
- const singleplayer = projectV3.singleplayer && projectV3.singleplayer[0];
- const clientAndServer = projectV3.client_and_server && projectV3.client_and_server[0];
- const clientOnly = projectV3.client_only && projectV3.client_only[0];
- const serverOnly = projectV3.server_only && projectV3.server_only[0];
+ const singleplayer = projectV3.singleplayer && projectV3.singleplayer[0]
+ const clientAndServer = projectV3.client_and_server && projectV3.client_and_server[0]
+ const clientOnly = projectV3.client_only && projectV3.client_only[0]
+ const serverOnly = projectV3.server_only && projectV3.server_only[0]
// quick and dirty hack to show envs as legacy
if (singleplayer && clientAndServer && !clientOnly && !serverOnly) {
- clientSide = "required";
- serverSide = "required";
+ clientSide = 'required'
+ serverSide = 'required'
} else if (singleplayer && clientAndServer && clientOnly && !serverOnly) {
- clientSide = "required";
- serverSide = "unsupported";
+ clientSide = 'required'
+ serverSide = 'unsupported'
} else if (singleplayer && clientAndServer && !clientOnly && serverOnly) {
- clientSide = "unsupported";
- serverSide = "required";
+ clientSide = 'unsupported'
+ serverSide = 'required'
} else if (singleplayer && clientAndServer && clientOnly && serverOnly) {
- clientSide = "optional";
- serverSide = "optional";
+ clientSide = 'optional'
+ serverSide = 'optional'
}
const projectV2: Project = {
@@ -109,7 +131,7 @@ async function fetchOrganization() {
})
if (!organization.value) {
- return;
+ return
}
breadcrumbs.setName('Organization', organization.value.name)
@@ -130,20 +152,19 @@ const themeStore = useTheming()
async function copyId() {
if (organization.value) {
- await navigator.clipboard.writeText(String(organization.value.id));
+ await navigator.clipboard.writeText(String(organization.value.id))
}
}
const sumDownloads = computed(() => {
- let sum = 0;
+ let sum = 0
for (const project of projects.value) {
- sum += project.downloads;
+ sum += project.downloads
}
- return sum;
-});
-
+ return sum
+})