fix: in-app browser download opens file inline
- Detect in-app WebViews (WeChat / TokenPocket / imToken / Telegram / iOS WKWebView, etc.) and show a guide modal asking the user to open the link in their system browser, with a copy-link action. - For normal browsers, fetch the attachment as a Blob and trigger download from a same-origin object URL so the file always lands in the user's Downloads folder with the original filename, even when the browser would otherwise inline-preview the response. - Fall back to the anchor download for files larger than 50MB (avoid loading them entirely into memory) or when fetch fails. - Pass `sizeBytes` from known call sites so the threshold actually applies. - Add localized strings for the guide modal in all 7 locales. See .unipi/docs/debug/2026-06-05-in-app-browser-download-debug.md.
This commit is contained in:
@@ -38,7 +38,9 @@ function LatestActions({
|
||||
if (!attachment || isDownloading) return;
|
||||
setIsDownloading(true);
|
||||
try {
|
||||
await downloadAttachment(post.id, attachment.id, attachment.filename);
|
||||
await downloadAttachment(post.id, attachment.id, attachment.filename, {
|
||||
sizeBytes: attachment.sizeBytes,
|
||||
});
|
||||
const mediaKind = mediaSaveKindFromAttachment(attachment);
|
||||
if (mediaKind) showSaveToAlbumGuide(mediaKind);
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user