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 ''
|
return ''
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const toast = useToast()
|
||||||
const copyToClipboard = async (text: string) => {
|
const copyToClipboard = async (text: string) => {
|
||||||
try {
|
try {
|
||||||
await navigator.clipboard.writeText(text)
|
await navigator.clipboard.writeText(text)
|
||||||
|
toast.add({
|
||||||
|
title: 'Copiado al portapapeles',
|
||||||
|
icon: 'i-lucide-check',
|
||||||
|
color: 'success',
|
||||||
|
timeout: 2000
|
||||||
|
})
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('Failed to copy:', 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) => {
|
const copyToClipboard = async (text: string) => {
|
||||||
try {
|
try {
|
||||||
await navigator.clipboard.writeText(text)
|
await navigator.clipboard.writeText(text)
|
||||||
|
toast.add({
|
||||||
|
title: 'Copiado al portapapeles',
|
||||||
|
icon: 'i-lucide-check',
|
||||||
|
color: 'success',
|
||||||
|
timeout: 2000
|
||||||
|
})
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('Failed to copy:', err)
|
console.error('Failed to copy:', err)
|
||||||
|
toast.add({
|
||||||
|
title: 'Error al copiar',
|
||||||
|
icon: 'i-lucide-x',
|
||||||
|
color: 'error',
|
||||||
|
timeout: 2000
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -472,11 +472,24 @@ watch(messages, () => {
|
|||||||
}, { deep: true })
|
}, { deep: true })
|
||||||
|
|
||||||
// Copy to clipboard function
|
// Copy to clipboard function
|
||||||
|
const toast = useToast()
|
||||||
const copyToClipboard = async (text: string) => {
|
const copyToClipboard = async (text: string) => {
|
||||||
try {
|
try {
|
||||||
await navigator.clipboard.writeText(text)
|
await navigator.clipboard.writeText(text)
|
||||||
|
toast.add({
|
||||||
|
title: 'Copiado al portapapeles',
|
||||||
|
icon: 'i-lucide-check',
|
||||||
|
color: 'success',
|
||||||
|
timeout: 2000
|
||||||
|
})
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('Failed to copy:', 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