Skip to content

Commit 5c4c71e

Browse files
committed
Email button fix
1 parent 532c457 commit 5c4c71e

File tree

5 files changed

+12
-21
lines changed

5 files changed

+12
-21
lines changed

src/client/components/ChatV2/ChatV2.tsx

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -568,17 +568,8 @@ const LeftMenu = ({
568568
<OutlineButtonBlack startIcon={<RestartAltIcon />} onClick={handleReset} id="empty-conversation-button">
569569
{t('chat:emptyConversation')}
570570
</OutlineButtonBlack>
571-
<Tooltip
572-
title={
573-
<Typography variant="body2" sx={{ p: 0.5 }}>
574-
{t('info:email', { email: user?.email })}
575-
</Typography>
576-
}
577-
arrow
578-
placement="right"
579-
>
580-
<EmailButton messages={messages} disabled={!messages?.length} />
581-
</Tooltip>
571+
572+
<EmailButton messages={messages} disabled={!messages?.length} />
582573
<OutlineButtonBlack startIcon={<SettingsIcon />} onClick={() => setSettingsModalOpen(true)} id="settings-button">
583574
{t('chat:settings')}
584575
</OutlineButtonBlack>

src/client/components/ChatV2/EmailButton.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ const EmailButton = ({ messages, disabled }: { messages: Message[]; disabled: bo
179179
if (isLoading || !user?.email) return null
180180

181181
const handleSend = async () => {
182-
if (!user.email) {
182+
if (!user.email || !messages.length) {
183183
enqueueSnackbar(t('email:failure'), { variant: 'error' })
184184
return
185185
}
@@ -194,8 +194,8 @@ const EmailButton = ({ messages, disabled }: { messages: Message[]; disabled: bo
194194
}
195195

196196
return (
197-
<Tooltip title={<Typography variant="body2">{t('info:email', { email: user.email })}</Typography>}>
198-
<OutlineButtonBlack startIcon={<EmailIcon />} onClick={handleSend} disabled={disabled}>
197+
<Tooltip placement="right" title={<Typography variant="body2">{t('chat:email', { email: user.email })}</Typography>}>
198+
<OutlineButtonBlack startIcon={<EmailIcon />} onClick={handleSend}>
199199
{t('email:save')}
200200
</OutlineButtonBlack>
201201
</Tooltip>

src/client/locales/en.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
"info": {
5858
"title": "Instructions",
5959
"usage": "Tokens reset every month. To reduce token consumption, you can choose a free language model or clear the conversation each time you change the topic.",
60-
"email": "The conversation will be sent to {{email}}",
6160
"acceptDisclaimer": "I have read and understood these instructions"
6261
},
6362
"footer": {
@@ -99,7 +98,8 @@
9998
"errorInstructions": "Generating a response failed. We recommended saving the current conversation and starting a new one. You can also try another model. If the problem persists, please contact support.",
10099
"emptyReminder": "Please note that long conversations consume more tokens. We recommend that you clear the conversation whenever you change the topic of the conversation.",
101100
"modelDisabled": "Model is unavailable",
102-
"attachFile": "Attach file"
101+
"attachFile": "Attach file",
102+
"email": "The conversation will be sent to {{email}}"
103103
},
104104
"settings": {
105105
"prompt": "Conversation prompt",

src/client/locales/fi.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
"info": {
5858
"title": "Käyttöohje",
5959
"usage": "Tokenit nollaantuvat kuukauden välein. Vähentääksesi tokenien kulumista voit valita ilmaisen kielimallin tai tyhjentää keskustelun aina kun vaihdat keskustelun aihetta.",
60-
"email": "Keskustelu lähetetään osoitteeseen {{email}}",
6160
"acceptDisclaimer": "Olen lukenut ja ymmärtänyt käyttöohjeet"
6261
},
6362
"footer": {
@@ -99,7 +98,8 @@
9998
"errorInstructions": "Vastauksen generointi ei onnistunut. Suosittelemme tallentamaan nykyisen keskustelun ja aloittamaan uuden. Voit myös kokeilla toista mallia. Jos ongelma jatkuu, ota yhteyttä tukeen.",
10099
"emptyReminder": "Huomaathan, että pitkät keskustelut kuluttavat enemmän tokeneita. Suosittelemme tyhjentämään keskustelun aina, kun vaihdat keskustelun aihetta.",
101100
"modelDisabled": "Kielimalli ei ole käytettävissä",
102-
"attachFile": "Liitä tiedosto"
101+
"attachFile": "Liitä tiedosto",
102+
"email": "Keskustelu lähetetään osoitteeseen {{email}}"
103103
},
104104
"settings": {
105105
"prompt": "Keskustelun alustus",

src/client/locales/sv.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565
"info": {
6666
"title": "Bruksanvisning",
6767
"usage": "Lösenord nollställs varje månad. Du kan minska förbrukningen av token genom att välja en gratis språkmall eller genom att rensa konversationen varje gång du byter ämne.",
68-
"email": "Konversationen kommer att skickas till {{email}}",
6968
"acceptDisclaimer": "Jag har läst och förstått bruksanvisningen"
7069
},
7170
"footer": {
@@ -107,7 +106,8 @@
107106
"attachFile": "Bifoga fil",
108107
"allowSave": "Diskussionen kan sparas",
109108
"toBeSaved": "Diskussionen sparas anonymt",
110-
"errorInstructions": "Det gick inte att generera ett svar. Vi rekommenderar att du sparar den aktuella konversationen och startar en ny. Du kan också prova en annan modell. Om problemet kvarstår, kontakta supporten."
109+
"errorInstructions": "Det gick inte att generera ett svar. Vi rekommenderar att du sparar den aktuella konversationen och startar en ny. Du kan också prova en annan modell. Om problemet kvarstår, kontakta supporten.",
110+
"email": "Konversationen kommer att skickas till {{email}}"
111111
},
112112
"settings": {
113113
"prompt": "Samtalsstart",
@@ -290,4 +290,4 @@
290290
"cancel": "Avboka",
291291
"submit": "Skicka till"
292292
}
293-
}
293+
}

0 commit comments

Comments
 (0)