File size: 386 Bytes
ae01f49
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import pgAdmin from 'sources/pgadmin';

export async function copyToClipboard(text) {
  try {
    await navigator.clipboard.writeText(text);
  } catch(err) {
    /* Suppress error */
    pgAdmin.Browser.notifier.error('Does not have clipboard access');
  }
  localStorage.setItem('clipboard', text);
}

export function getFromClipboard() {
  return localStorage.getItem('clipboard');
}