diff --git a/src/components/buttons/likeButton.jsx b/src/components/buttons/likeButton.jsx
index fc07768..65a7662 100644
--- a/src/components/buttons/likeButton.jsx
+++ b/src/components/buttons/likeButton.jsx
@@ -75,22 +75,31 @@ const LikeButton = ({ itemId, isFavorite, queryKey, userId, itemName }) => {
return { currentLatestMedia };
},
onError: (error, a, context) => {
+ enqueueSnackbar(`${error}`, {
+ variant: "error",
+ });
enqueueSnackbar(
`An error occured while updating "${itemName}"`,
{
variant: "error",
},
);
+
queryClient.setQueryData(queryKey, context.previousData);
- console.error(error);
+ setIsLoading(false);
setIsError(true);
+ console.log("set");
+
+ console.error(error);
},
onSuccess: () => {
console.log("Successfully updated", itemId);
queryClient.invalidateQueries(queryKey);
+ setIsLoading(false);
setIsSuccess(true);
},
onSettled: () => {
+ console.log("set");
setIsLoading(false);
},
});
diff --git a/src/components/buttons/markPlayedButton.jsx b/src/components/buttons/markPlayedButton.jsx
index d582616..dded071 100644
--- a/src/components/buttons/markPlayedButton.jsx
+++ b/src/components/buttons/markPlayedButton.jsx
@@ -80,12 +80,14 @@ const MarkPlayedButton = ({ itemId, isPlayed, queryKey, userId, itemName }) => {
},
);
queryClient.setQueryData(queryKey, context.previousData);
- console.error(error);
+ setIsLoading(false);
setIsError(true);
+ console.error(error);
},
onSuccess: () => {
console.log("Successfully updated", itemId);
queryClient.invalidateQueries(queryKey);
+ setIsLoading(false);
setIsSuccess(true);
},
onSettled: () => {
diff --git a/src/components/card/card.jsx b/src/components/card/card.jsx
index 14374ff..8f43d44 100644
--- a/src/components/card/card.jsx
+++ b/src/components/card/card.jsx
@@ -56,6 +56,7 @@ export const Card = ({
onClick,
disableOverlay = false,
disablePadding,
+ overrideIcon,
}) => {
const ref = useRef();
const isVisible = useIntersecting(ref);
@@ -172,18 +173,26 @@ export const Card = ({
/>
)}
- {TypeIconCollectionCard[item.Type]}
+ {!!overrideIcon
+ ? TypeIconCollectionCard[overrideIcon]
+ : TypeIconCollectionCard[item.Type]}
{
>
{
`/login/withImg/${item.Name}/${item.Id}/`,
)
}
+ overrideIcon="User"
+ imageType="Primary"
/>
);