Skip to content

Commit

Permalink
fix(sqllab): fix error message (#14651)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenLYZ authored May 17, 2021
1 parent b5e9854 commit 2320bd4
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ SyntaxHighlighter.registerLanguage('json', jsonSyntax);

const SyntaxHighlighterWrapper = styled.div`
margin-top: -24px;
&:hover {
svg {
visibility: visible;
}
}
svg {
position: relative;
top: 40px;
Expand All @@ -64,13 +66,13 @@ export default function SyntaxHighlighterCopy({
function copyToClipboard(textToCopy: string) {
copyTextToClipboard(textToCopy)
.then(() => {
if (addDangerToast) {
addDangerToast(t('Sorry, your browser does not support copying.'));
if (addSuccessToast) {
addSuccessToast(t('SQL Copied!'));
}
})
.catch(() => {
if (addSuccessToast) {
addSuccessToast(t('SQL Copied!'));
if (addDangerToast) {
addDangerToast(t('Sorry, your browser does not support copying.'));
}
});
}
Expand Down

0 comments on commit 2320bd4

Please sign in to comment.