fix(ui): NProgress not showing when mutation is running
This commit is contained in:
2 files changed
+5
-3
No files matched your search
+1
-1
@@ -288,7 +288,7 @@ function AppReady() {
|
||||
<ThemeProvider theme={theme}>
|
||||
<CssBaseline />
|
||||
<NProgress
|
||||
isAnimating={isQueryFetching}
|
||||
isAnimating={isQueryFetching || isMutating}
|
||||
key={isQueryFetching || isMutating ? "fetching" : "notFetching"}
|
||||
/>
|
||||
<Dialog
|
||||
|
||||
@@ -19,17 +19,19 @@ const MarkPlayedButton = ({ itemId, isPlayed, queryKey, userId, itemName }) => {
|
||||
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,
|
||||
|
||||
Reference in new issue
Block a user