mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-01-24 07:16:52 -06:00
dcfef154ce
- Upgrade ESLint to v9.x and migrate the .eslintrc.js file to make it work
16 lines
381 B
JavaScript
16 lines
381 B
JavaScript
import pgAdmin from 'sources/pgadmin';
|
|
|
|
export async function copyToClipboard(text) {
|
|
try {
|
|
await navigator.clipboard.writeText(text);
|
|
} catch {
|
|
/* Suppress error */
|
|
pgAdmin.Browser.notifier.error('Does not have clipboard access');
|
|
}
|
|
localStorage.setItem('clipboard', text);
|
|
}
|
|
|
|
export function getFromClipboard() {
|
|
return localStorage.getItem('clipboard');
|
|
}
|