(text)
| 1 | import pgAdmin from 'sources/pgadmin'; |
| 2 | |
| 3 | export async function copyToClipboard(text) { |
| 4 | try { |
| 5 | await navigator.clipboard.writeText(text); |
| 6 | } catch { |
| 7 | /* Suppress error */ |
| 8 | pgAdmin.Browser.notifier.error('Does not have clipboard access'); |
| 9 | } |
| 10 | localStorage.setItem('clipboard', text); |
| 11 | } |
| 12 | |
| 13 | export function getFromClipboard() { |
| 14 | return localStorage.getItem('clipboard'); |
no test coverage detected