Skip to content

Commit 6632523

Browse files
committed
chore: remove <hr/> at the end when copying (#73)
1 parent fc982e4 commit 6632523

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/components/ConversationCard/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ function ConversationCard(props) {
137137
}<br>${t('And refresh this page or type you question again')}` +
138138
`<br><br>${t(
139139
'Consider creating an api key at https://platform.openai.com/account/api-keys',
140-
)}<hr>`,
140+
)}\n<hr/>`,
141141
false,
142142
'error',
143143
)
@@ -151,7 +151,7 @@ function ConversationCard(props) {
151151
}<br>${t('And refresh this page or type you question again')}` +
152152
`<br><br>${t(
153153
'Consider creating an api key at https://platform.openai.com/account/api-keys',
154-
)}<hr>`,
154+
)}\n<hr/>`,
155155
false,
156156
'error',
157157
)

src/components/ConversationItem/index.jsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function ConversationItem({ type, content, session, done, port, onRetry }
1616
<div className="gpt-header">
1717
<p>{t('You')}:</p>
1818
<div className="gpt-util-group">
19-
<CopyButton contentFn={() => content} size={14} />
19+
<CopyButton contentFn={() => content.replace(/\n<hr\/>$/, '')} size={14} />
2020
{!collapsed ? (
2121
<span
2222
title={t('Collapse')}
@@ -63,7 +63,9 @@ export function ConversationItem({ type, content, session, done, port, onRetry }
6363
<SyncIcon size={14} />
6464
</span>
6565
)}
66-
{session && <CopyButton contentFn={() => content} size={14} />}
66+
{session && (
67+
<CopyButton contentFn={() => content.replace(/\n<hr\/>$/, '')} size={14} />
68+
)}
6769
{!collapsed ? (
6870
<span
6971
title={t('Collapse')}
@@ -97,7 +99,7 @@ export function ConversationItem({ type, content, session, done, port, onRetry }
9799
<SyncIcon size={14} />
98100
</span>
99101
)}
100-
<CopyButton contentFn={() => content} size={14} />
102+
<CopyButton contentFn={() => content.replace(/\n<hr\/>$/, '')} size={14} />
101103
{!collapsed ? (
102104
<span
103105
title={t('Collapse')}

0 commit comments

Comments
 (0)