fix(download): keep iOS home screen app saves in-app via the share sheet

This commit is contained in:
Chris Scott committed 2026-09-14 20:22:55 -04:00
1 parent b21c80c9e8
commit 2c00d244d9
9 files changed
+150 -46

No files matched your search

@@ -24,6 +24,7 @@ import { useServerHealth } from '@/hooks/useServerHealth'
import { useOpenCodeServerActions } from '@/hooks/useOpenCodeServerActions'
import { parseJsonc, hasJsoncComments } from '@/lib/jsonc'
import { showToast } from '@/lib/toast'
import { saveFile } from '@/lib/download'
import { invalidateConfigCaches } from '@/lib/queryInvalidation'
import { getOpenCodeApiErrorMessage } from '@/lib/opencode-errors'
import { FetchError } from '@/api/fetchWrapper'
@@ -308,12 +309,7 @@ export function OpenCodeConfigManager() {
const content = config.rawContent || JSON.stringify(config.content, null, 2)
const extension = config.rawContent && hasJsoncComments(config.rawContent) ? 'jsonc' : 'json'
const blob = new Blob([content], { type: 'application/json' })
const url = URL.createObjectURL(blob)
const a = document.createElement('a')
a.href = url
a.download = `${config.name}.${extension}`
a.click()
URL.revokeObjectURL(url)
void saveFile(blob, `${config.name}.${extension}`)
}