🛠️ Fixed eslint errors

This commit is contained in:
pheralb
2025-08-31 14:25:57 +01:00
parent a488bd4c7a
commit 5df7a336ba
8 changed files with 20 additions and 24 deletions
+10 -14
View File
@@ -1,5 +1,5 @@
<script lang="ts">
import type { Component, Snippet, SvelteComponent } from "svelte";
import type { Component } from "svelte";
import { cn } from "@/utils/cn";
import CopyIcon from "@lucide/svelte/icons/copy";
@@ -18,21 +18,17 @@
let timeoutId: ReturnType<typeof setTimeout> | null = null;
const handleCopy = async () => {
try {
await clipboard(code);
await clipboard(code);
if (timeoutId) {
clearTimeout(timeoutId);
}
copied = true;
timeoutId = setTimeout(() => {
copied = false;
timeoutId = null;
}, copyDuration);
} catch (error) {
copied = false;
if (timeoutId) {
clearTimeout(timeoutId);
}
copied = true;
timeoutId = setTimeout(() => {
copied = false;
timeoutId = null;
}, copyDuration);
};
$effect(() => {