chore: remove <hr/> at the end when copying (#73)

This commit is contained in:
josc146
2023-03-31 20:46:40 +08:00
parent 9b37f358d4
commit 6d57803ea9
2 changed files with 7 additions and 5 deletions
+2 -2
View File
@@ -137,7 +137,7 @@ function ConversationCard(props) {
}<br>${t('And refresh this page or type you question again')}` +
`<br><br>${t(
'Consider creating an api key at https://platform.openai.com/account/api-keys',
)}<hr>`,
)}\n<hr/>`,
false,
'error',
)
@@ -151,7 +151,7 @@ function ConversationCard(props) {
}<br>${t('And refresh this page or type you question again')}` +
`<br><br>${t(
'Consider creating an api key at https://platform.openai.com/account/api-keys',
)}<hr>`,
)}\n<hr/>`,
false,
'error',
)
+5 -3
View File
@@ -16,7 +16,7 @@ export function ConversationItem({ type, content, session, done, port, onRetry }
<div className="gpt-header">
<p>{t('You')}:</p>
<div className="gpt-util-group">
<CopyButton contentFn={() => content} size={14} />
<CopyButton contentFn={() => content.replace(/\n<hr\/>$/, '')} size={14} />
{!collapsed ? (
<span
title={t('Collapse')}
@@ -63,7 +63,9 @@ export function ConversationItem({ type, content, session, done, port, onRetry }
<SyncIcon size={14} />
</span>
)}
{session && <CopyButton contentFn={() => content} size={14} />}
{session && (
<CopyButton contentFn={() => content.replace(/\n<hr\/>$/, '')} size={14} />
)}
{!collapsed ? (
<span
title={t('Collapse')}
@@ -97,7 +99,7 @@ export function ConversationItem({ type, content, session, done, port, onRetry }
<SyncIcon size={14} />
</span>
)}
<CopyButton contentFn={() => content} size={14} />
<CopyButton contentFn={() => content.replace(/\n<hr\/>$/, '')} size={14} />
{!collapsed ? (
<span
title={t('Collapse')}