diff --git a/CLAUDE.md b/CLAUDE.md index fe48257fe..4f94b3ce8 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -30,7 +30,7 @@ This is the Modrinth monorepo — it contains all Modrinth projects, both fronte | `api-client` | API client for Nuxt, Tauri, and Node/browser | | `app-lib` | Shared app library | | `blog` | Blog system and changelog data | -| `utils` | Shared utility functions | +| `utils` | Shared utility functions (mostly deprecated) | | `moderation` | Moderation utilities | | `daedalus` | Daedalus protocol | | `tooling-config` | ESLint, Prettier, TypeScript configs | @@ -85,6 +85,7 @@ Each project may have its own `CLAUDE.md` with detailed instructions: ### General - Do not create new non-source code files (e.g. Bash scripts, SQL scripts) unless explicitly prompted to - For Frontend, when doing lint checks, only use the `prepr` commands, do not use `typecheck` or `tsc` etc. +- Types in `@modrinth/utils` are considered highly outdated, if a component needs them, check if you can switch said component to use types from `packages/api-client` ## Edit Tool - Whitespace Handling (CLAUDE ONLY) diff --git a/apps/frontend/src/components/ui/NotificationItem.vue b/apps/frontend/src/components/ui/NotificationItem.vue index c56f32978..bf6fac681 100644 --- a/apps/frontend/src/components/ui/NotificationItem.vue +++ b/apps/frontend/src/components/ui/NotificationItem.vue @@ -328,6 +328,7 @@ import { Categories, CopyCode, DoubleIcon, + injectModrinthClient, injectNotificationManager, ProjectStatusBadge, useFormatDateTime, @@ -341,6 +342,7 @@ import { acceptTeamInvite, removeSelfFromTeam } from '~/helpers/teams' import ThreadSummary from './thread/ThreadSummary.vue' +const client = injectModrinthClient() const { addNotification } = injectNotificationManager() const emit = defineEmits(['update:notifications']) const formatRelativeTime = useRelativeTime() @@ -407,7 +409,7 @@ async function read() { ? props.notification.grouped_notifs.map((notif) => notif.id) : []), ] - const updateNotifs = await markAsRead(ids) + const updateNotifs = await markAsRead(client, ids) const newNotifs = updateNotifs(props.notifications) emit('update:notifications', newNotifs) } catch (err) { diff --git a/apps/frontend/src/components/ui/charts/ChartDisplay.vue b/apps/frontend/src/components/ui/charts/ChartDisplay.vue index 6966ea788..39564d4cb 100644 --- a/apps/frontend/src/components/ui/charts/ChartDisplay.vue +++ b/apps/frontend/src/components/ui/charts/ChartDisplay.vue @@ -357,7 +357,7 @@ const props = withDefaults( }, ) -const projects = ref(props.projects || []) +const projects = computed(() => props.projects || []) // const selectedChart = ref('downloads') const selectedChart = computed({ @@ -389,6 +389,13 @@ const tinyRevenueChart = ref() const selectedDisplayProjects = ref(props.projects || []) +watch( + () => props.projects, + (newProjects) => { + selectedDisplayProjects.value = newProjects || [] + }, +) + const removeProjectFromDisplay = (id: string) => { selectedDisplayProjects.value = selectedDisplayProjects.value.filter((p) => p.id !== id) } diff --git a/apps/frontend/src/components/ui/create/CreateLimitAlert.vue b/apps/frontend/src/components/ui/create/CreateLimitAlert.vue index 8dbc29676..1c628574f 100644 --- a/apps/frontend/src/components/ui/create/CreateLimitAlert.vue +++ b/apps/frontend/src/components/ui/create/CreateLimitAlert.vue @@ -42,13 +42,18 @@ diff --git a/apps/frontend/src/pages/dashboard/collections.vue b/apps/frontend/src/pages/dashboard/collections.vue index 737c016db..87ee588bc 100644 --- a/apps/frontend/src/pages/dashboard/collections.vue +++ b/apps/frontend/src/pages/dashboard/collections.vue @@ -155,6 +155,7 @@ import { commonMessages, defineMessages, DropdownSelect, + injectModrinthClient, StyledInput, useCompactNumber, useVIntl, @@ -162,7 +163,6 @@ import { import { useQuery } from '@tanstack/vue-query' import CollectionCreateModal from '~/components/ui/create/CollectionCreateModal.vue' -import { useBaseFetch } from '~/composables/fetch.js' const { formatMessage } = useVIntl() const { formatCompactNumber, formatCompactNumberPlural } = useCompactNumber() @@ -216,6 +216,7 @@ useHead({ const auth = await useAuth() const user = await useUser() +const client = injectModrinthClient() if (import.meta.client) { await initUserFollows() @@ -225,7 +226,7 @@ const filterQuery = ref('') const { data: collections } = useQuery({ queryKey: ['user', auth.value.user.id, 'collections'], - queryFn: () => useBaseFetch(`user/${auth.value.user.id}/collections`, { apiVersion: 3 }), + queryFn: () => client.labrinth.users_v2.getCollections(auth.value.user.id), }) const route = useNativeRoute() diff --git a/apps/frontend/src/pages/dashboard/index.vue b/apps/frontend/src/pages/dashboard/index.vue index 68b3d2714..5c1a818e6 100644 --- a/apps/frontend/src/pages/dashboard/index.vue +++ b/apps/frontend/src/pages/dashboard/index.vue @@ -97,7 +97,7 @@