Skip to content

Commit

Permalink
Fix document is not defined for jsConfetti
Browse files Browse the repository at this point in the history
  • Loading branch information
pheralb committed Mar 21, 2024
1 parent 79986bc commit df00ce7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/links/create-link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export function CreateLink(props: CreateLinkProps) {
const [open, setOpen] = useState<boolean>(false);
const [message, setMessage] = useState<string>("");
const [isError, setError] = useState<boolean>(false);
const jsConfetti = new JSConfetti();

// Main form:
const form = useForm<z.infer<typeof CreateLinkSchema>>({
Expand Down Expand Up @@ -110,10 +109,11 @@ export function CreateLink(props: CreateLinkProps) {
};

const generateConfetti = async () => {
const jsConfetti = new JSConfetti();
await jsConfetti.addConfetti({
confettiColors: ["#fdd835", "#4caf50", "#2196f3", "#f44336", "#ff9800"],
confettiRadius: 3,
confettiNumber: 50
confettiNumber: 50,
});
};

Expand Down

0 comments on commit df00ce7

Please sign in to comment.