mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-14 02:15:57 +00:00
fix(ui): strip query params from file block name for display and extension detection
This commit is contained in:
1 parent
f0b5b61c8e
commit
afbecd3e4c
1 file changed
+3
-1
@@ -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(() => {
|
||||
|
||||
Reference in new issue
Block a user