forked from open-webui/open-webui
chore: refac
This commit is contained in:
parent
f30d16a3fd
commit
cc49e0d10f
11 changed files with 239 additions and 397 deletions
|
@ -66,9 +66,9 @@ export const getGravatarURL = (email) => {
|
|||
return `https://www.gravatar.com/avatar/${hash}`;
|
||||
};
|
||||
|
||||
const copyToClipboard = (text) => {
|
||||
export const copyToClipboard = (text) => {
|
||||
if (!navigator.clipboard) {
|
||||
var textArea = document.createElement('textarea');
|
||||
const textArea = document.createElement('textarea');
|
||||
textArea.value = text;
|
||||
|
||||
// Avoid scrolling to bottom
|
||||
|
@ -81,8 +81,8 @@ const copyToClipboard = (text) => {
|
|||
textArea.select();
|
||||
|
||||
try {
|
||||
var successful = document.execCommand('copy');
|
||||
var msg = successful ? 'successful' : 'unsuccessful';
|
||||
const successful = document.execCommand('copy');
|
||||
const msg = successful ? 'successful' : 'unsuccessful';
|
||||
console.log('Fallback: Copying text command was ' + msg);
|
||||
} catch (err) {
|
||||
console.error('Fallback: Oops, unable to copy', err);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue