feat: imgur proxying for blocked countries (#7104)

This commit is contained in:
Calum H.
2026-08-11 16:40:03 +00:00
committed by GitHub
parent 26e05ee9e5
commit 2d567b93ce
12 changed files with 167 additions and 37 deletions
+1 -1
View File
@@ -300,7 +300,7 @@ const {
setModpackAlreadyInstalledModal,
handleModpackDuplicateCreateAnyway,
handleModpackDuplicateGoToInstance,
} = setupProviders(notificationManager, popupNotificationManager)
} = setupProviders(tauriApiClient, notificationManager, popupNotificationManager)
const news = ref([])
const displayedServerInviteNotifications = new Set()
+4
View File
@@ -1,3 +1,4 @@
import type { AbstractModrinthClient } from '@modrinth/api-client'
import type { AbstractPopupNotificationManager, AbstractWebNotificationManager } from '@modrinth/ui'
import { setupCreationModal } from './setup/creation-modal'
@@ -5,11 +6,14 @@ import { setupFileDropProvider } from './setup/file-drop'
import { setupFilePickerProvider } from './setup/file-picker'
import { setupInstanceImportProvider } from './setup/instance-import'
import { setupTagsProvider } from './setup/tags'
import { setupUserCountryProvider } from './setup/user-country'
export function setupProviders(
client: AbstractModrinthClient,
notificationManager: AbstractWebNotificationManager,
_popupNotificationManager: AbstractPopupNotificationManager,
) {
setupUserCountryProvider(client)
setupTagsProvider(notificationManager)
setupFileDropProvider()
setupFilePickerProvider()
@@ -0,0 +1,16 @@
import type { AbstractModrinthClient } from '@modrinth/api-client'
import { provideUserCountry } from '@modrinth/ui'
import { ref } from 'vue'
export function setupUserCountryProvider(client: AbstractModrinthClient) {
const country = ref('US')
void client.labrinth.geoip
.getCountry()
.then((detectedCountry) => {
country.value = detectedCountry ?? country.value
})
.catch(() => {})
return provideUserCountry(country)
}