Skip to content

Commit

Permalink
fix: Copy button success toast
Browse files Browse the repository at this point in the history
  • Loading branch information
CNSeniorious000 committed Jul 1, 2024
1 parent b93ad7d commit 8c42c8d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/lib/components/console/Copy.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<script lang="ts">
import Markdown from "../Markdown.svelte";
import { md } from "$lib/markdown";
import { toast } from "svelte-sonner";
export let text: string;
Expand All @@ -10,9 +9,7 @@
const n = text.split("\n").length;
const html = await md`successfully copied \`${n}\` ${n === 1 ? "line" : "lines"} to clipboard`;
toast.success(Markdown, { componentProps: { html } });
toast.success(Markdown, { componentProps: { text: `successfully copied \`${n}\` ${n === 1 ? "line" : "lines"} to clipboard` } });
navigator.clipboard.writeText(text);
}
</script>
Expand Down

0 comments on commit 8c42c8d

Please sign in to comment.