From 46adb89682aa4847d8fabaf5e4dc01c428857006 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Mon, 7 Aug 2023 11:03:13 +0800 Subject: [PATCH] Fix success message when copying text --- .../web/components/templates/article/HighlightsLayer.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/web/components/templates/article/HighlightsLayer.tsx b/packages/web/components/templates/article/HighlightsLayer.tsx index f095918f3..84372b1aa 100644 --- a/packages/web/components/templates/article/HighlightsLayer.tsx +++ b/packages/web/components/templates/article/HighlightsLayer.tsx @@ -479,9 +479,12 @@ export function HighlightsLayer(props: HighlightsLayerProps): JSX.Element { if (textToCopy) { try { await navigator.clipboard.writeText(textToCopy) - showSuccessToast('Highlight copied', { - position: 'bottom-right', - }) + showSuccessToast( + focusedHighlight ? 'Highlight copied' : 'Text copied', + { + position: 'bottom-right', + } + ) } catch (error) { showErrorToast('Error copying highlight, permission denied.', { position: 'bottom-right',