Skip to content

Commit

Permalink
fix(apps/mobile): only show toast success for upload and delete image
Browse files Browse the repository at this point in the history
  • Loading branch information
hassankhan committed Oct 13, 2024
1 parent 75da54b commit aa5a0a2
Showing 1 changed file with 44 additions and 44 deletions.
88 changes: 44 additions & 44 deletions apps/mobile/src/store/middleware/ToastMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,17 @@ startAppListening({
},
});

startAppListening({
matcher: CatApi.endpoints.upvoteImage.matchFulfilled,
effect: async (action, { dispatch }) => {
await dispatch(
showToast({
title: `🔼 ${TITLE_SUCCESS}`,
message: 'Your upvote was successful',
})
);
},
});
// startAppListening({
// matcher: CatApi.endpoints.upvoteImage.matchFulfilled,
// effect: async (action, { dispatch }) => {
// await dispatch(
// showToast({
// title: `🔼 ${TITLE_SUCCESS}`,
// message: 'Your upvote was successful',
// })
// );
// },
// });

startAppListening({
matcher: CatApi.endpoints.upvoteImage.matchRejected,
Expand All @@ -96,17 +96,17 @@ startAppListening({
},
});

startAppListening({
matcher: CatApi.endpoints.downvoteImage.matchFulfilled,
effect: async (action, { dispatch }) => {
await dispatch(
showToast({
title: `🔽 ${TITLE_SUCCESS}`,
message: 'Your downvote was successful',
})
);
},
});
// startAppListening({
// matcher: CatApi.endpoints.downvoteImage.matchFulfilled,
// effect: async (action, { dispatch }) => {
// await dispatch(
// showToast({
// title: `🔽 ${TITLE_SUCCESS}`,
// message: 'Your downvote was successful',
// })
// );
// },
// });

startAppListening({
matcher: CatApi.endpoints.downvoteImage.matchRejected,
Expand All @@ -123,17 +123,17 @@ startAppListening({
},
});

startAppListening({
matcher: CatApi.endpoints.favouriteImage.matchFulfilled,
effect: async (action, { dispatch }) => {
await dispatch(
showToast({
title: `❤️ ${TITLE_SUCCESS}`,
message: 'Favourited the kitty successfully',
})
);
},
});
// startAppListening({
// matcher: CatApi.endpoints.favouriteImage.matchFulfilled,
// effect: async (action, { dispatch }) => {
// await dispatch(
// showToast({
// title: `❤️ ${TITLE_SUCCESS}`,
// message: 'Favourited the kitty successfully',
// })
// );
// },
// });

startAppListening({
matcher: CatApi.endpoints.favouriteImage.matchRejected,
Expand All @@ -150,17 +150,17 @@ startAppListening({
},
});

startAppListening({
matcher: CatApi.endpoints.unfavouriteImage.matchFulfilled,
effect: async (action, { dispatch }) => {
await dispatch(
showToast({
title: `💔 ${TITLE_SUCCESS}`,
message: 'Image unfavourited successfully',
})
);
},
});
// startAppListening({
// matcher: CatApi.endpoints.unfavouriteImage.matchFulfilled,
// effect: async (action, { dispatch }) => {
// await dispatch(
// showToast({
// title: `💔 ${TITLE_SUCCESS}`,
// message: 'Image unfavourited successfully',
// })
// );
// },
// });

startAppListening({
matcher: CatApi.endpoints.unfavouriteImage.matchRejected,
Expand Down

0 comments on commit aa5a0a2

Please sign in to comment.