fix: Support the Clipboard API in modern browsers (#20058)

* fix: Support the Clipboard API in modern browsers

* fix tests

* PR comment

* Improvements
This commit is contained in:
Diego Medina
2022-06-03 07:34:00 -04:00
committed by GitHub
parent 92057858c2
commit 0e38c686c6
11 changed files with 118 additions and 57 deletions

View File

@@ -168,8 +168,7 @@ export const useExploreAdditionalActionsMenu = (
if (!latestQueryFormData) {
throw new Error();
}
const url = await getChartPermalink(latestQueryFormData);
await copyTextToClipboard(url);
await copyTextToClipboard(() => getChartPermalink(latestQueryFormData));
addSuccessToast(t('Copied to clipboard!'));
} catch (error) {
addDangerToast(t('Sorry, something went wrong. Try again later.'));