Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions apps/frontend/src/composables/fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,7 @@ async function getRateLimitKey(config) {
if (cachedRateLimitKey !== undefined) return cachedRateLimitKey

if (!rateLimitKeyPromise) {
rateLimitKeyPromise = (async () => {
try {
const { env } = await import('cloudflare:workers')
return await env.RATE_LIMIT_IGNORE_KEY?.get()
} catch {
return undefined
}
})()
rateLimitKeyPromise = process.env.RATE_LIMIT_IGNORE_KEY
}

cachedRateLimitKey = await rateLimitKeyPromise
Expand Down
9 changes: 1 addition & 8 deletions apps/frontend/src/helpers/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,7 @@ import {
import type { Ref } from 'vue'

async function getRateLimitKeyFromSecretsStore(): Promise<string | undefined> {
try {
// @ts-expect-error only avail in workers env
const { env } = await import('cloudflare:workers')
return await env.RATE_LIMIT_IGNORE_KEY?.get()
} catch {
// Not running in Cloudflare Workers environment
return undefined
}
return process.env.RATE_LIMIT_IGNORE_KEY
}

export function createModrinthClient(
Expand Down