fix(sqllab): fix error message (#14651)

This commit is contained in:
Yaozong Liu 2021-05-18 07:20:03 +08:00 committed by GitHub
parent b5e9854ddc
commit 2320bd44d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -36,11 +36,13 @@ SyntaxHighlighter.registerLanguage('json', jsonSyntax);
const SyntaxHighlighterWrapper = styled.div`
margin-top: -24px;
&:hover {
svg {
visibility: visible;
}
}
svg {
position: relative;
top: 40px;
@ -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.'));
}
});
}