diff --git a/app/src/Send.jsx b/app/src/Send.jsx index 04721050..ae2091ba 100644 --- a/app/src/Send.jsx +++ b/app/src/Send.jsx @@ -20,16 +20,13 @@ import { X, } from 'lucide-react' import { isApp } from './api.js' -import { DEFAULT_HOST, EXTENSIONS, connect, deleteFiles, folders, isBook, joinPath, listFiles, loadDevicePrefs, makeFolder, renameFile, saveDevicePrefs } from './device.js' +import { DEFAULT_HOST, connect, deleteFiles, folders, isBook, joinPath, listFiles, loadDevicePrefs, makeFolder, renameFile, saveDevicePrefs } from './device.js' import { downloads as listDownloads, removeDownload, sendDownload, sendFile } from './catalogs.js' import { ActionSheet, Card, EmptyState, folderLabel, notify, Toggle } from './ui.jsx' import ConversionLog from './ConversionLog.jsx' import { transferProgress } from './epub/log.js' const size = (n) => (n < 1024 * 1024 ? `${Math.max(1, Math.round(n / 1024))} KB` : `${(n / 1024 / 1024).toFixed(1)} MB`) -// Android's picker filters by MIME type and has none for .md, so let it show everything there. -const ACCEPT = /android/i.test(navigator.userAgent) ? undefined : EXTENSIONS.map((e) => `.${e}`).join(',') - // Shared progress from the WebView optimizer and native transfers. export function progressLabel(p) { if (!p) return 'Sending…' @@ -476,7 +473,7 @@ export default function Send() {
- Send EPUB, Markdown or text files over Wi-Fi. + Send EPUB, Markdown, text or ACSM files over Wi-Fi.
{!isApp ? ( @@ -492,7 +489,8 @@ export default function Send() { ref={input} type="file" multiple - accept={ACCEPT} + // Native type filters can disable unknown extensions such as ACSM on iOS. + // Validate supported extensions in add() after selection instead. className="hidden" onChange={(e) => { add(e.target.files) @@ -518,12 +516,12 @@ export default function Send() {- Skipped {skipped} file{skipped === 1 ? '' : 's'}: your reader only takes EPUB, Markdown and text. + Skipped {skipped} file{skipped === 1 ? '' : 's'}: choose EPUB, Markdown, text or ACSM files.
)} diff --git a/app/src/device.js b/app/src/device.js index bb82fb4f..23c5c3dc 100644 --- a/app/src/device.js +++ b/app/src/device.js @@ -5,7 +5,7 @@ import { DEFAULT_QUALITY } from './epub/optimize.js' // CrossPoint's on-device file server (File Transfer screen). Same protocol // common-stacks uses: GET /api/status, GET /api/files?path=, POST /upload?path=. export const DEFAULT_HOST = 'crosspoint.local' -export const EXTENSIONS = ['epub', 'md', 'txt'] +export const EXTENSIONS = ['epub', 'md', 'txt', 'acsm'] const ext = (name) => name.split('.').pop().toLowerCase() export const isBook = (file) => EXTENSIONS.includes(ext(file.name))