fix(ui): strip query params from file block name for display and extension detection

This commit is contained in:
viettranx committed 2026-03-25 13:49:27 +07:00
1 parent f0b5b61c8e
commit afbecd3e4c
1 file changed
+3 -1
+3 -1
View File
@@ -177,7 +177,9 @@ function isMarkdownFile(name: string, mime: string): boolean {
return /\.(md|mdx|markdown)$/i.test(name) || mime.startsWith("text/markdown");
}
function FileBlock({ name, mime, content }: { name: string; mime: string; content: string }) {
function FileBlock({ name: rawName, mime, content }: { name: string; mime: string; content: string }) {
// Strip query params (e.g. ?ft=token) from filename for display and extension detection
const name = rawName.replace(/\?.*$/, "");
const [open, setOpen] = useState(false);
const handleDownload = useCallback(() => {