add toast when copying url to clipboard

This commit is contained in:
2026-06-28 20:22:35 +02:00
parent a1328e8908
commit dbec92375c
4 changed files with 42 additions and 3 deletions
@@ -1,7 +1,7 @@
<script lang="ts">
import { Clipboard, InformationCircle } from '@steeze-ui/heroicons';
import { Icon } from '@steeze-ui/svelte-icon';
import { isMobile } from '@/entrypoints/popup/state';
import { isMobile, showToast } from '@/entrypoints/popup/state';
/* types */
interface Props {
@@ -28,8 +28,13 @@
}
/* callbacks */
function copyUrl() {
navigator.clipboard.writeText(urlOutput);
async function copyUrl() {
try {
await navigator.clipboard.writeText(urlOutput);
showToast('URL copied');
} catch {
showToast('Failed to copy');
}
}
</script>