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:
Marco Beretta 2024-08-17 00:03:27 +02:00 committed by GitHub
parent 16c9aed1bb
commit 9f4c516615
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 22 additions and 18 deletions

View file

@ -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

View file

@ -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

View file

@ -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 {

18
package-lock.json generated
View file

@ -13151,11 +13151,12 @@
}
},
"node_modules/axios": {
"version": "1.6.7",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.6.7.tgz",
"integrity": "sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==",
"version": "1.7.4",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.7.4.tgz",
"integrity": "sha512-DukmaFRnY6AzAALSH4J2M3k6PkaC+MfaAGdEERRWcC9q3/TWQwLpHR8ZRLKTdQ3aBDL64EdluRDjJqKw+BPZEw==",
"license": "MIT",
"dependencies": {
"follow-redirects": "^1.15.4",
"follow-redirects": "^1.15.6",
"form-data": "^4.0.0",
"proxy-from-env": "^1.1.0"
}
@ -15607,9 +15608,10 @@
"integrity": "sha512-9AQB5eFTHyR3Gvt2t/NwR0le2jBSUNwCnMbUCejFWHD+so4tH40/dRLgoE+jxlPeWS43XJewyvCv+I8LPMl49Q=="
},
"node_modules/elliptic": {
"version": "6.5.4",
"resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz",
"integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==",
"version": "6.5.7",
"resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.7.tgz",
"integrity": "sha512-ESVCtTwiA+XhY3wyh24QqRGBoP3rEdDUl3EDUUo9tft074fi19IrdpH7hLCMMP3CIj7jb3W96rn8lt/BqIlt5Q==",
"license": "MIT",
"dependencies": {
"bn.js": "^4.11.9",
"brorand": "^1.1.0",
@ -31491,7 +31493,7 @@
},
"packages/data-provider": {
"name": "librechat-data-provider",
"version": "0.7.41.0",
"version": "0.7.412",
"license": "ISC",
"dependencies": {
"@types/js-yaml": "^4.0.9",