fix error page not having country provider (#7159)

This commit is contained in:
Prospector
2026-08-14 19:18:22 -07:00
committed by GitHub
parent 4897c2da94
commit 9582c1a6fd
3 changed files with 4 additions and 28 deletions
-3
View File
@@ -15,12 +15,9 @@ import { I18nDebugPanel, LoadingBar, NotificationPanel } from '@modrinth/ui'
import AdsConsentNotification from '~/components/ui/AdsConsentNotification.vue'
import { setupProviders } from '~/providers/setup.ts'
import { setupUserCountryProvider } from '~/providers/setup/user-country.ts'
import { useAuth } from './composables/auth'
setupUserCountryProvider()
const auth = await useAuth()
setupProviders(auth)
</script>
+2 -25
View File
@@ -97,39 +97,16 @@ import {
LoadingBar,
normalizeChildren,
NotificationPanel,
provideModrinthClient,
provideNotificationManager,
providePageContext,
useVIntl,
} from '@modrinth/ui'
import Logo404 from '~/assets/images/404.svg'
import { getSignInRouteObj } from '~/composables/auth.js'
import { logout } from '~/composables/user.js'
import { createModrinthClient } from './helpers/api.ts'
import { FrontendNotificationManager } from './providers/frontend-notifications.ts'
import { setupLoadingStateProvider } from './providers/setup/loading-state.ts'
import { setupProviders } from '~/providers/setup.ts'
const auth = await useAuth()
const config = useRuntimeConfig()
provideNotificationManager(new FrontendNotificationManager())
setupLoadingStateProvider()
const client = createModrinthClient(auth.value, {
apiBaseUrl: config.public.apiBaseUrl.replace('/v2/', '/'),
archonBaseUrl: config.public.pyroBaseUrl.replace('/v2/', '/'),
sharedInstancesBaseUrl: config.public.sharedInstancesBaseUrl,
rateLimitKey: config.rateLimitKey,
})
provideModrinthClient(client)
providePageContext({
hierarchicalSidebarAvailable: ref(false),
showAds: ref(false),
adConsentAvailable: ref(false),
openExternalUrl: (url) => window.open(url, '_blank'),
})
setupProviders(auth)
const { formatMessage } = useVIntl()
+2
View File
@@ -7,6 +7,7 @@ import { setupLoadingStateProvider } from './setup/loading-state'
import { setupModrinthClientProvider } from './setup/modrinth-client'
import { setupPageContextProvider } from './setup/page-context'
import { setupTagsProvider } from './setup/tags'
import { setupUserCountryProvider } from './setup/user-country'
export function setupProviders(auth: Awaited<ReturnType<typeof useAuth>>) {
provideNotificationManager(new FrontendNotificationManager())
@@ -17,4 +18,5 @@ export function setupProviders(auth: Awaited<ReturnType<typeof useAuth>>) {
setupFilePickerProvider()
setupPageContextProvider()
setupLoadingStateProvider()
setupUserCountryProvider()
}