Skip to content

Commit

Permalink
fix ts errors
Browse files Browse the repository at this point in the history
  • Loading branch information
flosrn committed Jan 12, 2024
1 parent af5c54b commit b9dc6a1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,15 @@ const RemoveFromBoardButton = ({
) => {
event.preventDefault();
try {
selectedPosters.map(async (posterId) => {
addToRemoveFromBoard(posterId);
await removeFromMutation.mutateAsync({
posterId,
boardId,
});
});
await Promise.all(
selectedPosters.map(async (posterId) => {
addToRemoveFromBoard(posterId);
await removeFromMutation.mutateAsync({
posterId,
boardId,
});
})
);
clearSelectedPosters();
clearToRemoveFromBoard();
} catch {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ const DeleteButton = ({ isSelectedPostersEmpty }: DeleteButtonProps) => {
const handleDelete = async (event: React.MouseEvent<HTMLButtonElement>) => {
event.preventDefault();
try {
selectedPosters.map(async (id) => deleteMutation.mutateAsync(id));
await Promise.all(
selectedPosters.map(async (id) => deleteMutation.mutateAsync(id))
);
clearSelectedPosters();
toggleSelectBar();
} catch {
Expand Down
5 changes: 3 additions & 2 deletions src/components/hero/stars-particles.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
"use client";

import React, { useCallback } from "react";
import Particles from "react-particles";
import { Particles } from "react-particles";
import { loadFull } from "tsparticles";
import type { Engine } from "tsparticles-engine";

type StarsParticlesProps = {};

const StarsParticles = ({}: StarsParticlesProps) => {
const particlesInit = useCallback(async (engine: Engine) => {
await loadFull(engine);
// @ts-expect-error - no types for this
return await loadFull(engine);
}, []);

return (
Expand Down

0 comments on commit b9dc6a1

Please sign in to comment.