UI: Agregar notificaciones toast a todas las funciones de copiar en Mensajes
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m43s
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m43s
This commit is contained in:
@@ -130,11 +130,24 @@ const lastMessagePreview = computed(() => {
|
||||
return ''
|
||||
})
|
||||
|
||||
const toast = useToast()
|
||||
const copyToClipboard = async (text: string) => {
|
||||
try {
|
||||
await navigator.clipboard.writeText(text)
|
||||
toast.add({
|
||||
title: 'Copiado al portapapeles',
|
||||
icon: 'i-lucide-check',
|
||||
color: 'success',
|
||||
timeout: 2000
|
||||
})
|
||||
} catch (err) {
|
||||
console.error('Failed to copy:', err)
|
||||
toast.add({
|
||||
title: 'Error al copiar',
|
||||
icon: 'i-lucide-x',
|
||||
color: 'error',
|
||||
timeout: 2000
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -316,11 +316,24 @@ const formatTime = (date: Date) => {
|
||||
})
|
||||
}
|
||||
|
||||
const toast = useToast()
|
||||
const copyToClipboard = async (text: string) => {
|
||||
try {
|
||||
await navigator.clipboard.writeText(text)
|
||||
toast.add({
|
||||
title: 'Copiado al portapapeles',
|
||||
icon: 'i-lucide-check',
|
||||
color: 'success',
|
||||
timeout: 2000
|
||||
})
|
||||
} catch (err) {
|
||||
console.error('Failed to copy:', err)
|
||||
toast.add({
|
||||
title: 'Error al copiar',
|
||||
icon: 'i-lucide-x',
|
||||
color: 'error',
|
||||
timeout: 2000
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -472,11 +472,24 @@ watch(messages, () => {
|
||||
}, { deep: true })
|
||||
|
||||
// Copy to clipboard function
|
||||
const toast = useToast()
|
||||
const copyToClipboard = async (text: string) => {
|
||||
try {
|
||||
await navigator.clipboard.writeText(text)
|
||||
toast.add({
|
||||
title: 'Copiado al portapapeles',
|
||||
icon: 'i-lucide-check',
|
||||
color: 'success',
|
||||
timeout: 2000
|
||||
})
|
||||
} catch (err) {
|
||||
console.error('Failed to copy:', err)
|
||||
toast.add({
|
||||
title: 'Error al copiar',
|
||||
icon: 'i-lucide-x',
|
||||
color: 'error',
|
||||
timeout: 2000
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user