fix: modal shift on close + readd settings preload (#6448)

* fix: NewModal layout shift on close

* fix: preload queries in settings modals

* fix: any
This commit is contained in:
Calum H.
2026-06-19 20:23:35 +00:00
committed by GitHub
parent ac5daad280
commit 56536abb24
9 changed files with 178 additions and 91 deletions
@@ -1,7 +1,7 @@
<script setup lang="ts">
import type { Archon } from '@modrinth/api-client'
import { ChevronRightIcon } from '@modrinth/assets'
import { useQueryClient } from '@tanstack/vue-query'
import { useQuery, useQueryClient } from '@tanstack/vue-query'
import { computed, nextTick, ref } from 'vue'
import type { TabbedModalTab } from '#ui/components'
@@ -60,6 +60,16 @@ const currentUserRole = ref<string | null>(null)
const isApp = ref(true)
// Preload
useQuery({
queryKey: computed(() => ['content', 'list', 'v1', currentServerId]),
queryFn: () =>
client.archon.content_v1.getAddons(currentServerId, worldId.value!, {
from_modpack: false,
}),
enabled: computed(() => !!worldId.value),
})
const serverSettingsTabComponentMap = {
general: ServerSettingsGeneralPage,
installation: ServerSettingsInstallationPage,
@@ -185,13 +195,6 @@ async function show({ serverId, tabIndex, tabId }: ShowOptions) {
queryKey: ['servers', 'properties', 'v1', targetServerId, worldId.value],
queryFn: () => client.archon.properties_v1.getProperties(targetServerId, worldId.value!),
})
queryClient.prefetchQuery({
queryKey: ['content', 'list', 'v1', targetServerId],
queryFn: () =>
client.archon.content_v1.getAddons(targetServerId, worldId.value!, {
from_modpack: false,
}),
})
queryClient.prefetchQuery({
queryKey: ['servers', 'startup', 'v1', targetServerId, worldId.value],
queryFn: () => client.archon.options_v1.getStartup(targetServerId, worldId.value!),