mirror of
https://github.com/ItzCrazyKns/Perplexica.git
synced 2025-06-19 00:08:43 +00:00
Compare commits
5 Commits
a3283ff3bb
...
be1fe039c5
Author | SHA1 | Date | |
---|---|---|---|
be1fe039c5 | |||
64d2a467b0 | |||
9a2c4fe3b6 | |||
060c68a900 | |||
4134770586 |
@ -75,6 +75,12 @@ router.post(
|
||||
}
|
||||
|
||||
const files = req.files['files'] as Express.Multer.File[];
|
||||
// Fixed the garbled issue of non-ASCII character filenames.
|
||||
files.forEach((file) => {
|
||||
file.originalname = Buffer.from(file.originalname, 'latin1').toString(
|
||||
'utf8',
|
||||
);
|
||||
});
|
||||
if (!files || files.length === 0) {
|
||||
res.status(400).json({ message: 'No files uploaded' });
|
||||
return;
|
||||
|
@ -48,11 +48,17 @@ const Chat = ({
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
messageEnd.current?.scrollIntoView({ behavior: 'smooth' });
|
||||
const scroll = () => {
|
||||
messageEnd.current?.scrollIntoView({ behavior: 'smooth' });
|
||||
};
|
||||
|
||||
if (messages.length === 1) {
|
||||
document.title = `${messages[0].content.substring(0, 30)} - Perplexica`;
|
||||
}
|
||||
|
||||
if (messages[messages.length - 1]?.role == 'user') {
|
||||
scroll();
|
||||
}
|
||||
}, [messages]);
|
||||
|
||||
return (
|
||||
|
@ -68,7 +68,13 @@ const MessageBox = ({
|
||||
return (
|
||||
<div>
|
||||
{message.role === 'user' && (
|
||||
<div className={cn('w-full', messageIndex === 0 ? 'pt-16' : 'pt-8', 'break-words')}>
|
||||
<div
|
||||
className={cn(
|
||||
'w-full',
|
||||
messageIndex === 0 ? 'pt-16' : 'pt-8',
|
||||
'break-words',
|
||||
)}
|
||||
>
|
||||
<h2 className="text-black dark:text-white font-medium text-3xl lg:w-9/12">
|
||||
{message.content}
|
||||
</h2>
|
||||
|
Reference in New Issue
Block a user