From 455a499670b22eea6acf217725f1f7313ce5696b Mon Sep 17 00:00:00 2001 From: Prayag Prajapati Date: Sat, 24 Feb 2024 14:26:48 +0530 Subject: [PATCH] fix(ui): NProgress not showing when mutation is running --- src/App.tsx | 2 +- src/components/buttons/markPlayedButton.jsx | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 240f415..e25701c 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -288,7 +288,7 @@ function AppReady() { { const { enqueueSnackbar } = useSnackbar(); const handleMarking = async () => { + let result = null; if (!isPlayed) { - return await getPlaystateApi(api).markPlayedItem({ + result = await getPlaystateApi(api).markPlayedItem({ userId: userId, itemId: itemId, }); } else if (isPlayed) { - return await getPlaystateApi(api).markUnplayedItem({ + result = await getPlaystateApi(api).markUnplayedItem({ userId: userId, itemId: itemId, }); } + return result; }; const mutation = useMutation({ mutationFn: handleMarking,