mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-31 07:38:52 +01:00
fix: fileName formatting fixes
This commit is contained in:
parent
4245b43140
commit
31cef16cc3
4 changed files with 103 additions and 5 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import React, { useEffect, useState } from 'react';
|
||||
import { useRecoilValue, useRecoilCallback } from 'recoil';
|
||||
import filenamify from 'filenamify';
|
||||
import exportFromJSON from 'export-from-json';
|
||||
import download from 'downloadjs';
|
||||
import DialogTemplate from '~/components/ui/DialogTemplate.jsx';
|
||||
|
|
@ -40,9 +41,7 @@ export default function ExportModel({ open, onOpenChange }) {
|
|||
|
||||
useEffect(() => {
|
||||
setFileName(
|
||||
String(conversation?.title)
|
||||
.replace(/[^a-z0-9]/gi, '_')
|
||||
.toLowerCase() || 'file'
|
||||
filenamify(String(conversation?.title || 'file'))
|
||||
);
|
||||
setType('text');
|
||||
setIncludeOptions(true);
|
||||
|
|
@ -292,7 +291,7 @@ export default function ExportModel({ open, onOpenChange }) {
|
|||
<Input
|
||||
id="filename"
|
||||
value={filename}
|
||||
onChange={e => setFileName(e.target.value || '')}
|
||||
onChange={e => setFileName(filenamify(e.target.value || ''))}
|
||||
placeholder="Set the filename"
|
||||
className={cn(
|
||||
defaultTextProps,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue