From 4ad6daa45ce0a916a165eeb88f8939c7580dc932 Mon Sep 17 00:00:00 2001 From: "Cal H." Date: Fri, 15 Aug 2025 19:02:55 +0100 Subject: [PATCH] fix: DI nonsense (#4174) * fix: DI nonsense * fix: lint * fix: client try di issue * fix: injects outside of context * fix: use .catch * refactor: convert projects.vue to composition API. * fix: moderation checklist notif pos change watcher * fix: lint issues --- .../src/components/RowDisplay.vue | 9 +- .../src/components/ui/Instance.vue | 2 +- .../src/components/ui/SearchCard.vue | 6 +- .../src/components/ui/URLConfirmModal.vue | 9 +- .../ui/install_flow/ModInstallModal.vue | 4 +- .../ui/instance_settings/JavaSettings.vue | 7 +- .../ui/settings/DefaultInstanceSettings.vue | 9 +- .../src/composables/useMemorySlider.js | 4 +- apps/app-frontend/src/helpers/fetch.js | 7 +- apps/app-frontend/src/helpers/profile.js | 6 +- apps/app-frontend/src/helpers/skins.ts | 4 +- apps/app-frontend/src/pages/Skins.vue | 9 +- .../app-frontend/src/pages/instance/Index.vue | 2 +- apps/app-frontend/src/pages/project/Index.vue | 2 +- apps/app-frontend/src/store/install.js | 41 +-- .../checklist/ModerationChecklist.vue | 8 +- .../ui/servers/FilesUploadZipUrlModal.vue | 11 +- apps/frontend/src/composables/auth.js | 30 +- .../composables/servers/modrinth-servers.ts | 9 +- .../src/composables/use-client-try.ts | 18 +- apps/frontend/src/composables/user.js | 26 +- apps/frontend/src/layouts/default.vue | 19 +- apps/frontend/src/pages/[type]/[id].vue | 12 - .../src/pages/[type]/[id]/gallery.vue | 20 +- .../pages/[type]/[id]/version/[version].vue | 24 +- apps/frontend/src/pages/auth/verify-email.vue | 25 +- .../frontend/src/pages/dashboard/projects.vue | 268 +++++++----------- .../src/pages/dashboard/revenue/index.vue | 14 +- .../organization/[id]/settings/index.vue | 8 +- .../src/pages/servers/manage/[id]/files.vue | 11 +- apps/frontend/src/pages/settings/account.vue | 11 +- .../src/providers/organization-context.ts | 6 +- 32 files changed, 318 insertions(+), 323 deletions(-) diff --git a/apps/app-frontend/src/components/RowDisplay.vue b/apps/app-frontend/src/components/RowDisplay.vue index b0114653..363f0744 100644 --- a/apps/app-frontend/src/components/RowDisplay.vue +++ b/apps/app-frontend/src/components/RowDisplay.vue @@ -165,7 +165,14 @@ const handleOptionsClick = async (args) => { await navigator.clipboard.writeText(args.item.path) break case 'install': { - await installVersion(args.item.project_id, null, null, 'ProjectCardContextMenu') + await installVersion( + args.item.project_id, + null, + null, + 'ProjectCardContextMenu', + () => {}, + () => {}, + ).catch(handleError) break } diff --git a/apps/app-frontend/src/components/ui/Instance.vue b/apps/app-frontend/src/components/ui/Instance.vue index 19c29ac3..73940147 100644 --- a/apps/app-frontend/src/components/ui/Instance.vue +++ b/apps/app-frontend/src/components/ui/Instance.vue @@ -94,7 +94,7 @@ const stop = async (e, context) => { const repair = async (e) => { e?.stopPropagation() - await finish_install(props.instance) + await finish_install(props.instance).catch(handleError) } const openFolder = async () => { diff --git a/apps/app-frontend/src/components/ui/SearchCard.vue b/apps/app-frontend/src/components/ui/SearchCard.vue index 553d86e2..7f7b6c44 100644 --- a/apps/app-frontend/src/components/ui/SearchCard.vue +++ b/apps/app-frontend/src/components/ui/SearchCard.vue @@ -118,7 +118,7 @@ diff --git a/apps/app-frontend/src/components/ui/install_flow/ModInstallModal.vue b/apps/app-frontend/src/components/ui/install_flow/ModInstallModal.vue index 54201acd..ccf6586e 100644 --- a/apps/app-frontend/src/components/ui/install_flow/ModInstallModal.vue +++ b/apps/app-frontend/src/components/ui/install_flow/ModInstallModal.vue @@ -110,7 +110,7 @@ async function install(instance) { } await installMod(instance.path, version.id).catch(handleError) - await installVersionDependencies(instance, version) + await installVersionDependencies(instance, version).catch(handleError) instance.installedMod = true instance.installing = false @@ -185,7 +185,7 @@ const createInstance = async () => { await router.push(`/instance/${encodeURIComponent(id)}/`) const instance = await get(id, true) - await installVersionDependencies(instance, versions.value[0]) + await installVersionDependencies(instance, versions.value[0]).catch(handleError) trackEvent('InstanceCreate', { profile_name: name.value, diff --git a/apps/app-frontend/src/components/ui/instance_settings/JavaSettings.vue b/apps/app-frontend/src/components/ui/instance_settings/JavaSettings.vue index 382feeea..fbc110f8 100644 --- a/apps/app-frontend/src/components/ui/instance_settings/JavaSettings.vue +++ b/apps/app-frontend/src/components/ui/instance_settings/JavaSettings.vue @@ -16,7 +16,7 @@ const { formatMessage } = useVIntl() const props = defineProps() -const globalSettings = (await get().catch(handleError)) as AppSettings +const globalSettings = (await get().catch(handleError)) as unknown as AppSettings const overrideJavaInstall = ref(!!props.instance.java_path) const optimalJava = readonly(await get_optimal_jre_key(props.instance.path).catch(handleError)) @@ -36,7 +36,10 @@ const envVars = ref( const overrideMemorySettings = ref(!!props.instance.memory) const memory = ref(props.instance.memory ?? globalSettings.memory) -const { maxMemory, snapPoints } = await useMemorySlider() +const { maxMemory, snapPoints } = (await useMemorySlider().catch(handleError)) as unknown as { + maxMemory: number + snapPoints: number[] +} const editProfileObject = computed(() => { const editProfile: { diff --git a/apps/app-frontend/src/components/ui/settings/DefaultInstanceSettings.vue b/apps/app-frontend/src/components/ui/settings/DefaultInstanceSettings.vue index 72699166..f9ffd696 100644 --- a/apps/app-frontend/src/components/ui/settings/DefaultInstanceSettings.vue +++ b/apps/app-frontend/src/components/ui/settings/DefaultInstanceSettings.vue @@ -1,17 +1,22 @@ diff --git a/apps/frontend/src/pages/dashboard/projects.vue b/apps/frontend/src/pages/dashboard/projects.vue index 81283bb1..a396daa9 100644 --- a/apps/frontend/src/pages/dashboard/projects.vue +++ b/apps/frontend/src/pages/dashboard/projects.vue @@ -300,7 +300,7 @@ -