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

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

* fix: apply CodeRabbit auto-fixes
This commit is contained in:
Chris Scott authored and GitHub committed 2026-09-18 22:35:54 -04:00
1 parent b21c80c9e8
commit 7a3c5229df
9 files changed
+203 -48

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}`)
}