mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
2. Fixed an issue where the Query Editor loses focus when saving a query (Alt+s). Fixes #7521 3. Ensure that an error is thrown if clipboard access is not provided and change the copy rows shortcut. Fixes #7452
16 lines
375 B
JavaScript
16 lines
375 B
JavaScript
import Notifier from './helpers/Notifier';
|
|
|
|
export async function copyToClipboard(text) {
|
|
try {
|
|
await navigator.clipboard.writeText(text);
|
|
} catch(err) {
|
|
/* Suppress error */
|
|
Notifier.error('Does not have clipboard acccess');
|
|
}
|
|
localStorage.setItem('clipboard', text);
|
|
}
|
|
|
|
export function getFromClipboard() {
|
|
return localStorage.getItem('clipboard');
|
|
}
|