mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-23 11:50:14 +01:00
⚓ fix: Export Button Content Shift; chore: bump axios and add logging (#3668)
* chore: bump axios version * fix: export button glitch * fix: remove console logs
This commit is contained in:
parent
16c9aed1bb
commit
9f4c516615
4 changed files with 22 additions and 18 deletions
|
|
@ -75,7 +75,7 @@ export function BrowserTTS({ isLast, index, messageId, content, className }: TMe
|
|||
}}
|
||||
src={audioRef.current?.src}
|
||||
onError={(error) => {
|
||||
console.error('Error fetching audio:', error);
|
||||
logger.error('Error fetching audio:', error);
|
||||
}}
|
||||
id={`audio-${messageId}`}
|
||||
muted
|
||||
|
|
@ -166,7 +166,7 @@ export function EdgeTTS({ isLast, index, messageId, content, className }: TMessa
|
|||
}}
|
||||
src={audioRef.current?.src}
|
||||
onError={(error) => {
|
||||
console.error('Error fetching audio:', error);
|
||||
logger.error('Error fetching audio:', error);
|
||||
}}
|
||||
id={`audio-${messageId}`}
|
||||
muted
|
||||
|
|
@ -245,7 +245,7 @@ export function ExternalTTS({ isLast, index, messageId, content, className }: TM
|
|||
}}
|
||||
src={audioRef.current?.src}
|
||||
onError={(error) => {
|
||||
console.error('Error fetching audio:', error);
|
||||
logger.error('Error fetching audio:', error);
|
||||
}}
|
||||
id={`audio-${messageId}`}
|
||||
muted
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { Upload, Share2 } from 'lucide-react';
|
|||
import { useRecoilValue } from 'recoil';
|
||||
import { ShareButton } from '~/components/Conversations/ConvoOptions';
|
||||
import { Button, DropdownPopup } from '~/components/ui';
|
||||
import useLocalize from '~/hooks/useLocalize';
|
||||
import { useMediaQuery, useLocalize } from '~/hooks';
|
||||
import { ExportModal } from '../Nav';
|
||||
import store from '~/store';
|
||||
|
||||
|
|
@ -17,6 +17,7 @@ export default function ExportAndShareMenu({
|
|||
const [isPopoverActive, setIsPopoverActive] = useState(false);
|
||||
const [showExports, setShowExports] = useState(false);
|
||||
const [showShareDialog, setShowShareDialog] = useState(false);
|
||||
const isSmallScreen = useMediaQuery('(max-width: 768px)');
|
||||
|
||||
const exportable =
|
||||
conversation &&
|
||||
|
|
@ -73,6 +74,7 @@ export default function ExportAndShareMenu({
|
|||
}
|
||||
items={dropdownItems}
|
||||
anchor="bottom end"
|
||||
className={isSmallScreen ? '' : 'absolute right-0 top-0 mt-2'}
|
||||
/>
|
||||
{showShareDialog && conversation.conversationId != null && (
|
||||
<ShareButton
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ export default function StreamAudio({ index = 0 }) {
|
|||
|
||||
setAudioRunId(activeRunId);
|
||||
if (cachedResponse) {
|
||||
console.log('Audio found in cache');
|
||||
logger.log('Audio found in cache');
|
||||
const audioBlob = await cachedResponse.blob();
|
||||
const blobUrl = URL.createObjectURL(audioBlob);
|
||||
setGlobalAudioURL(blobUrl);
|
||||
|
|
@ -92,7 +92,7 @@ export default function StreamAudio({ index = 0 }) {
|
|||
return;
|
||||
}
|
||||
|
||||
console.log('Fetching audio...', navigator.userAgent);
|
||||
logger.log('Fetching audio...', navigator.userAgent);
|
||||
const response = await fetch('/api/files/speech/tts', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${token}` },
|
||||
|
|
@ -137,7 +137,7 @@ export default function StreamAudio({ index = 0 }) {
|
|||
}
|
||||
|
||||
if (chunks.length) {
|
||||
console.log('Adding audio to cache');
|
||||
logger.log('Adding audio to cache');
|
||||
const latestMessages = getMessages() ?? [];
|
||||
const targetMessage = latestMessages.find(
|
||||
(msg) => msg.messageId === latestMessage?.messageId,
|
||||
|
|
@ -161,13 +161,13 @@ export default function StreamAudio({ index = 0 }) {
|
|||
setIsFetching(false);
|
||||
}
|
||||
|
||||
console.log('Audio stream reading ended');
|
||||
logger.log('Audio stream reading ended');
|
||||
} catch (error) {
|
||||
if (error?.['message'] !== promiseTimeoutMessage) {
|
||||
console.log(promiseTimeoutMessage);
|
||||
logger.log(promiseTimeoutMessage);
|
||||
return;
|
||||
}
|
||||
console.error('Error fetching audio:', error);
|
||||
logger.error('Error fetching audio:', error);
|
||||
setIsFetching(false);
|
||||
setGlobalAudioURL(null);
|
||||
} finally {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue