fix(market-card.tsx): remove duplicate setLoading(true) call in handleAdd function to prevent unnecessary loading state changes

This commit is contained in:
anovazzi1 2023-10-24 21:03:13 -03:00
commit 8c4b88a49a

View file

@ -29,6 +29,7 @@ export const MarketCardComponent = ({ data }: { data: FlowComponent }) => {
}, [added]); }, [added]);
function handleAdd() { function handleAdd() {
setLoading(true);
getComponent(data.id).then( getComponent(data.id).then(
(res) => { (res) => {
console.log(res); console.log(res);
@ -160,7 +161,6 @@ export const MarketCardComponent = ({ data }: { data: FlowComponent }) => {
size="sm" size="sm"
className="whitespace-nowrap " className="whitespace-nowrap "
onClick={() => { onClick={() => {
setLoading(true);
if (!added) { if (!added) {
handleAdd(); handleAdd();
} else { } else {