Skip to content

Commit fe8d456

Browse files
fix(mobile): workspace PDFs with # or ? in the name get the Open PDF menu item
1 parent 89bf519 commit fe8d456

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎apps/mobile/src/features/files/ThreadFilesRouteScreen.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ import { FilePreviewModal, type FilePreviewSource } from "../../components/ui/Fi
4141
import { LoadingScreen } from "../../components/LoadingScreen";
4242
import { attachmentTextAtom, noAttachmentText } from "../../lib/attachmentDocument";
4343
import { copyTextWithHaptic } from "../../lib/copyTextWithHaptic";
44-
import { isPdfFile } from "../../lib/filePreview";
4544
import { tryOpenExternalUrl } from "../../lib/openExternalUrl";
4645
import { useUniwindTheme } from "../../lib/useUniwindTheme";
4746
import type { MediaVideoPreviewSource } from "../../lib/videoPreviewSource";
@@ -998,7 +997,8 @@ export function ThreadFileScreen(props: ThreadFileRouteScreenProps) {
998997
onPress: () => copyTextWithHaptic(fileContents),
999998
} as const)
1000999
: null,
1001-
isPdfFile({ name: relativePath }) && previewUri !== null
1000+
// A workspace path is literal: # and ? belong to the file name, not to a URL.
1001+
filePreviewKind({ name: relativePath }) === "pdf" && previewUri !== null
10021002
? ({
10031003
id: "open-pdf",
10041004
title: gt("Open PDF"),

0 commit comments

Comments
 (0)