feat(web): Add a global query fetch/mutation status
This commit is contained in:
6 files changed
+185
-22
No files matched your search
+2
-1
@@ -3,4 +3,5 @@
|
|||||||
- feat(web): Add new About page (#258) by @prayag17
|
- feat(web): Add new About page (#258) by @prayag17
|
||||||
- feat(web): Allow managing servers from settings dialog by @prayag17
|
- feat(web): Allow managing servers from settings dialog by @prayag17
|
||||||
- feat(search): Add Episode to search by @prayag17
|
- feat(search): Add Episode to search by @prayag17
|
||||||
- feat(settings-server): Add a refretch button by @prayag17
|
- feat(settings-server): Add a refretch button by @prayag17
|
||||||
|
- feat(web): Add a global query fetch/mutation status by @prayag17
|
||||||
@@ -19,6 +19,8 @@
|
|||||||
"@jellyfin/sdk": "0.8.2",
|
"@jellyfin/sdk": "0.8.2",
|
||||||
"@mui/lab": "5.0.0-alpha.165",
|
"@mui/lab": "5.0.0-alpha.165",
|
||||||
"@mui/material": "^5.15.10",
|
"@mui/material": "^5.15.10",
|
||||||
|
"@mui/styles": "^5.15.10",
|
||||||
|
"@tanem/react-nprogress": "^5.0.51",
|
||||||
"@tanstack/react-query": "^5.21.2",
|
"@tanstack/react-query": "^5.21.2",
|
||||||
"@tanstack/react-query-devtools": "^5.21.3",
|
"@tanstack/react-query-devtools": "^5.21.3",
|
||||||
"@tauri-apps/api": "^1.5.3",
|
"@tauri-apps/api": "^1.5.3",
|
||||||
|
|||||||
Generated
+130
@@ -26,6 +26,12 @@ dependencies:
|
|||||||
'@mui/material':
|
'@mui/material':
|
||||||
specifier: ^5.15.10
|
specifier: ^5.15.10
|
||||||
version: 5.15.10(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.56)(react-dom@18.2.0)(react@18.2.0)
|
version: 5.15.10(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.56)(react-dom@18.2.0)(react@18.2.0)
|
||||||
|
'@mui/styles':
|
||||||
|
specifier: ^5.15.10
|
||||||
|
version: 5.15.10(@types/react@18.2.56)(react@18.2.0)
|
||||||
|
'@tanem/react-nprogress':
|
||||||
|
specifier: ^5.0.51
|
||||||
|
version: 5.0.51(react-dom@18.2.0)(react@18.2.0)
|
||||||
'@tanstack/react-query':
|
'@tanstack/react-query':
|
||||||
specifier: ^5.21.2
|
specifier: ^5.21.2
|
||||||
version: 5.21.2(react@18.2.0)
|
version: 5.21.2(react@18.2.0)
|
||||||
@@ -1034,6 +1040,37 @@ packages:
|
|||||||
react: 18.2.0
|
react: 18.2.0
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
|
/@mui/styles@5.15.10(@types/react@18.2.56)(react@18.2.0):
|
||||||
|
resolution: {integrity: sha512-VUl9rCK89lkCZ+ctYv1hSCN9gBke9CfnXF9BtGPkw9jTxPkrW6fQQYep2wcHdzLORE3w96oq9BbSXDqrOnSEPA==}
|
||||||
|
engines: {node: '>=12.0.0'}
|
||||||
|
peerDependencies:
|
||||||
|
'@types/react': ^17.0.0 || ^18.0.0
|
||||||
|
react: ^17.0.0
|
||||||
|
peerDependenciesMeta:
|
||||||
|
'@types/react':
|
||||||
|
optional: true
|
||||||
|
dependencies:
|
||||||
|
'@babel/runtime': 7.23.9
|
||||||
|
'@emotion/hash': 0.9.1
|
||||||
|
'@mui/private-theming': 5.15.9(@types/react@18.2.56)(react@18.2.0)
|
||||||
|
'@mui/types': 7.2.13(@types/react@18.2.56)
|
||||||
|
'@mui/utils': 5.15.9(@types/react@18.2.56)(react@18.2.0)
|
||||||
|
'@types/react': 18.2.56
|
||||||
|
clsx: 2.1.0
|
||||||
|
csstype: 3.1.3
|
||||||
|
hoist-non-react-statics: 3.3.2
|
||||||
|
jss: 10.10.0
|
||||||
|
jss-plugin-camel-case: 10.10.0
|
||||||
|
jss-plugin-default-unit: 10.10.0
|
||||||
|
jss-plugin-global: 10.10.0
|
||||||
|
jss-plugin-nested: 10.10.0
|
||||||
|
jss-plugin-props-sort: 10.10.0
|
||||||
|
jss-plugin-rule-value-function: 10.10.0
|
||||||
|
jss-plugin-vendor-prefixer: 10.10.0
|
||||||
|
prop-types: 15.8.1
|
||||||
|
react: 18.2.0
|
||||||
|
dev: false
|
||||||
|
|
||||||
/@mui/system@5.15.9(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.56)(react@18.2.0):
|
/@mui/system@5.15.9(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.56)(react@18.2.0):
|
||||||
resolution: {integrity: sha512-SxkaaZ8jsnIJ77bBXttfG//LUf6nTfOcaOuIgItqfHv60ZCQy/Hu7moaob35kBb+guxVJnoSZ+7vQJrA/E7pKg==}
|
resolution: {integrity: sha512-SxkaaZ8jsnIJ77bBXttfG//LUf6nTfOcaOuIgItqfHv60ZCQy/Hu7moaob35kBb+guxVJnoSZ+7vQJrA/E7pKg==}
|
||||||
engines: {node: '>=12.0.0'}
|
engines: {node: '>=12.0.0'}
|
||||||
@@ -1354,6 +1391,18 @@ packages:
|
|||||||
- supports-color
|
- supports-color
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
|
/@tanem/react-nprogress@5.0.51(react-dom@18.2.0)(react@18.2.0):
|
||||||
|
resolution: {integrity: sha512-YxNUCpznuBVA+PhjEzFmxaa1czXgU+5Ojchw5JBK7DQS6SHIgNudpFohWpNBWMu2KWByGJ2OLH2OwbM/XyP18Q==}
|
||||||
|
peerDependencies:
|
||||||
|
react: ^16.8.0 || ^17.0.0 || ^18.0.0
|
||||||
|
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
|
||||||
|
dependencies:
|
||||||
|
'@babel/runtime': 7.23.9
|
||||||
|
hoist-non-react-statics: 3.3.2
|
||||||
|
react: 18.2.0
|
||||||
|
react-dom: 18.2.0(react@18.2.0)
|
||||||
|
dev: false
|
||||||
|
|
||||||
/@tanstack/query-core@5.21.2:
|
/@tanstack/query-core@5.21.2:
|
||||||
resolution: {integrity: sha512-jg7OcDG44oLT3uuGQQ9BM65ZBIdAq9xNZXPEk7Gr6w1oM1wo2/95H3dPDjLVs0yZKwrmE/ORUOC2Pyi1sp2fDA==}
|
resolution: {integrity: sha512-jg7OcDG44oLT3uuGQQ9BM65ZBIdAq9xNZXPEk7Gr6w1oM1wo2/95H3dPDjLVs0yZKwrmE/ORUOC2Pyi1sp2fDA==}
|
||||||
dev: false
|
dev: false
|
||||||
@@ -1986,6 +2035,13 @@ packages:
|
|||||||
which: 2.0.2
|
which: 2.0.2
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/css-vendor@2.0.8:
|
||||||
|
resolution: {integrity: sha512-x9Aq0XTInxrkuFeHKbYC7zWY8ai7qJ04Kxd9MnvbC1uO5DagxoHQjm4JvG+vCdXOoFtCjbL2XSZfxmoYa9uQVQ==}
|
||||||
|
dependencies:
|
||||||
|
'@babel/runtime': 7.23.9
|
||||||
|
is-in-browser: 1.1.3
|
||||||
|
dev: false
|
||||||
|
|
||||||
/csstype@3.1.3:
|
/csstype@3.1.3:
|
||||||
resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==}
|
resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==}
|
||||||
dev: false
|
dev: false
|
||||||
@@ -2694,6 +2750,10 @@ packages:
|
|||||||
resolution: {integrity: sha512-RJ8XvFvpPM/Dmc5SV+dC4y5PCeOhT3x1Hq0NU3rjGeg5a/CqlhZ7uudknPwZFz4aeAXDcbAyaeP7GAo9lvngtA==}
|
resolution: {integrity: sha512-RJ8XvFvpPM/Dmc5SV+dC4y5PCeOhT3x1Hq0NU3rjGeg5a/CqlhZ7uudknPwZFz4aeAXDcbAyaeP7GAo9lvngtA==}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
|
/hyphenate-style-name@1.0.4:
|
||||||
|
resolution: {integrity: sha512-ygGZLjmXfPHj+ZWh6LwbC37l43MhfztxetbFCoYTM2VjkIUpeHgSNn7QIyVFj7YQ1Wl9Cbw5sholVJPzWvC2MQ==}
|
||||||
|
dev: false
|
||||||
|
|
||||||
/ignore@5.3.1:
|
/ignore@5.3.1:
|
||||||
resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==}
|
resolution: {integrity: sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==}
|
||||||
engines: {node: '>= 4'}
|
engines: {node: '>= 4'}
|
||||||
@@ -2836,6 +2896,10 @@ packages:
|
|||||||
resolution: {integrity: sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg==}
|
resolution: {integrity: sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg==}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
|
/is-in-browser@1.1.3:
|
||||||
|
resolution: {integrity: sha512-FeXIBgG/CPGd/WUxuEyvgGTEfwiG9Z4EKGxjNMRqviiIIfsmgrpnHLffEDdwUHqNva1VEW91o3xBT/m8Elgl9g==}
|
||||||
|
dev: false
|
||||||
|
|
||||||
/is-map@2.0.2:
|
/is-map@2.0.2:
|
||||||
resolution: {integrity: sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==}
|
resolution: {integrity: sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==}
|
||||||
dev: true
|
dev: true
|
||||||
@@ -2983,6 +3047,68 @@ packages:
|
|||||||
graceful-fs: 4.2.11
|
graceful-fs: 4.2.11
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/jss-plugin-camel-case@10.10.0:
|
||||||
|
resolution: {integrity: sha512-z+HETfj5IYgFxh1wJnUAU8jByI48ED+v0fuTuhKrPR+pRBYS2EDwbusU8aFOpCdYhtRc9zhN+PJ7iNE8pAWyPw==}
|
||||||
|
dependencies:
|
||||||
|
'@babel/runtime': 7.23.9
|
||||||
|
hyphenate-style-name: 1.0.4
|
||||||
|
jss: 10.10.0
|
||||||
|
dev: false
|
||||||
|
|
||||||
|
/jss-plugin-default-unit@10.10.0:
|
||||||
|
resolution: {integrity: sha512-SvpajxIECi4JDUbGLefvNckmI+c2VWmP43qnEy/0eiwzRUsafg5DVSIWSzZe4d2vFX1u9nRDP46WCFV/PXVBGQ==}
|
||||||
|
dependencies:
|
||||||
|
'@babel/runtime': 7.23.9
|
||||||
|
jss: 10.10.0
|
||||||
|
dev: false
|
||||||
|
|
||||||
|
/jss-plugin-global@10.10.0:
|
||||||
|
resolution: {integrity: sha512-icXEYbMufiNuWfuazLeN+BNJO16Ge88OcXU5ZDC2vLqElmMybA31Wi7lZ3lf+vgufRocvPj8443irhYRgWxP+A==}
|
||||||
|
dependencies:
|
||||||
|
'@babel/runtime': 7.23.9
|
||||||
|
jss: 10.10.0
|
||||||
|
dev: false
|
||||||
|
|
||||||
|
/jss-plugin-nested@10.10.0:
|
||||||
|
resolution: {integrity: sha512-9R4JHxxGgiZhurDo3q7LdIiDEgtA1bTGzAbhSPyIOWb7ZubrjQe8acwhEQ6OEKydzpl8XHMtTnEwHXCARLYqYA==}
|
||||||
|
dependencies:
|
||||||
|
'@babel/runtime': 7.23.9
|
||||||
|
jss: 10.10.0
|
||||||
|
tiny-warning: 1.0.3
|
||||||
|
dev: false
|
||||||
|
|
||||||
|
/jss-plugin-props-sort@10.10.0:
|
||||||
|
resolution: {integrity: sha512-5VNJvQJbnq/vRfje6uZLe/FyaOpzP/IH1LP+0fr88QamVrGJa0hpRRyAa0ea4U/3LcorJfBFVyC4yN2QC73lJg==}
|
||||||
|
dependencies:
|
||||||
|
'@babel/runtime': 7.23.9
|
||||||
|
jss: 10.10.0
|
||||||
|
dev: false
|
||||||
|
|
||||||
|
/jss-plugin-rule-value-function@10.10.0:
|
||||||
|
resolution: {integrity: sha512-uEFJFgaCtkXeIPgki8ICw3Y7VMkL9GEan6SqmT9tqpwM+/t+hxfMUdU4wQ0MtOiMNWhwnckBV0IebrKcZM9C0g==}
|
||||||
|
dependencies:
|
||||||
|
'@babel/runtime': 7.23.9
|
||||||
|
jss: 10.10.0
|
||||||
|
tiny-warning: 1.0.3
|
||||||
|
dev: false
|
||||||
|
|
||||||
|
/jss-plugin-vendor-prefixer@10.10.0:
|
||||||
|
resolution: {integrity: sha512-UY/41WumgjW8r1qMCO8l1ARg7NHnfRVWRhZ2E2m0DMYsr2DD91qIXLyNhiX83hHswR7Wm4D+oDYNC1zWCJWtqg==}
|
||||||
|
dependencies:
|
||||||
|
'@babel/runtime': 7.23.9
|
||||||
|
css-vendor: 2.0.8
|
||||||
|
jss: 10.10.0
|
||||||
|
dev: false
|
||||||
|
|
||||||
|
/jss@10.10.0:
|
||||||
|
resolution: {integrity: sha512-cqsOTS7jqPsPMjtKYDUpdFC0AbhYFLTcuGRqymgmdJIeQ8cH7+AgX7YSgQy79wXloZq2VvATYxUOUQEvS1V/Zw==}
|
||||||
|
dependencies:
|
||||||
|
'@babel/runtime': 7.23.9
|
||||||
|
csstype: 3.1.3
|
||||||
|
is-in-browser: 1.1.3
|
||||||
|
tiny-warning: 1.0.3
|
||||||
|
dev: false
|
||||||
|
|
||||||
/jsx-ast-utils@3.3.5:
|
/jsx-ast-utils@3.3.5:
|
||||||
resolution: {integrity: sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==}
|
resolution: {integrity: sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==}
|
||||||
engines: {node: '>=4.0'}
|
engines: {node: '>=4.0'}
|
||||||
@@ -4231,6 +4357,10 @@ packages:
|
|||||||
resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==}
|
resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/tiny-warning@1.0.3:
|
||||||
|
resolution: {integrity: sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==}
|
||||||
|
dev: false
|
||||||
|
|
||||||
/to-fast-properties@2.0.0:
|
/to-fast-properties@2.0.0:
|
||||||
resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==}
|
resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==}
|
||||||
engines: {node: '>=4'}
|
engines: {node: '>=4'}
|
||||||
|
|||||||
+15
-13
@@ -108,6 +108,12 @@ import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
|
|||||||
import { useSnackbar } from "notistack";
|
import { useSnackbar } from "notistack";
|
||||||
import { ErrorBoundary } from "react-error-boundary";
|
import { ErrorBoundary } from "react-error-boundary";
|
||||||
|
|
||||||
|
import {
|
||||||
|
useIsFetching,
|
||||||
|
useIsMutating,
|
||||||
|
useQueryClient,
|
||||||
|
} from "@tanstack/react-query";
|
||||||
|
import NProgress from "./components/nProgress";
|
||||||
import Settings from "./components/settings";
|
import Settings from "./components/settings";
|
||||||
import { EasterEgg } from "./components/utils/easterEgg.jsx";
|
import { EasterEgg } from "./components/utils/easterEgg.jsx";
|
||||||
import { handleRelaunch } from "./utils/misc/relaunch";
|
import { handleRelaunch } from "./utils/misc/relaunch";
|
||||||
@@ -241,6 +247,11 @@ function AppReady() {
|
|||||||
undefined,
|
undefined,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const isQueryFetching = useIsFetching();
|
||||||
|
const isMutating = useIsMutating();
|
||||||
|
|
||||||
|
console.info(location.pathname + "----" + isQueryFetching);
|
||||||
|
|
||||||
useLayoutEffect(() => {
|
useLayoutEffect(() => {
|
||||||
async function checkForUpdates() {
|
async function checkForUpdates() {
|
||||||
try {
|
try {
|
||||||
@@ -278,19 +289,10 @@ function AppReady() {
|
|||||||
<SnackbarProvider maxSnack={5}>
|
<SnackbarProvider maxSnack={5}>
|
||||||
<ThemeProvider theme={theme}>
|
<ThemeProvider theme={theme}>
|
||||||
<CssBaseline />
|
<CssBaseline />
|
||||||
|
<NProgress
|
||||||
{playbackDataLoading && (
|
isAnimating={isQueryFetching}
|
||||||
<LinearProgress
|
key={isQueryFetching || isMutating ? "fetching" : "notFetching"}
|
||||||
sx={{
|
/>
|
||||||
position: "fixed",
|
|
||||||
top: 0,
|
|
||||||
left: 0,
|
|
||||||
right: 0,
|
|
||||||
width: "100vw",
|
|
||||||
zIndex: 100000,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
<Dialog
|
<Dialog
|
||||||
open={updateDialog}
|
open={updateDialog}
|
||||||
fullWidth
|
fullWidth
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
import { LinearProgress } from "@mui/material";
|
||||||
|
import { useNProgress } from "@tanem/react-nprogress";
|
||||||
|
import React from "react";
|
||||||
|
|
||||||
|
const NProgress: React.FC<{ isAnimating: boolean | number }> = ({
|
||||||
|
isAnimating,
|
||||||
|
}) => {
|
||||||
|
const { animationDuration, isFinished, progress } = useNProgress({
|
||||||
|
isAnimating,
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
opacity: isFinished ? 0 : 1,
|
||||||
|
pointerEvents: "none",
|
||||||
|
transition: `opacity ${animationDuration}ms linear`,
|
||||||
|
position: "fixed",
|
||||||
|
top: "0",
|
||||||
|
left: "0",
|
||||||
|
right: "0",
|
||||||
|
zIndex: "10000",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<LinearProgress
|
||||||
|
sx={{
|
||||||
|
transitionDuration: animationDuration,
|
||||||
|
}}
|
||||||
|
value={progress * 100}
|
||||||
|
variant="determinate"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default NProgress;
|
||||||
@@ -10,14 +10,6 @@ const ItemSkeleton = () => {
|
|||||||
width: "100vw",
|
width: "100vw",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<LinearProgress
|
|
||||||
sx={{
|
|
||||||
position: "fixed",
|
|
||||||
top: "0",
|
|
||||||
left: 0,
|
|
||||||
right: 0,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<div
|
<div
|
||||||
className="item-hero flex flex-row"
|
className="item-hero flex flex-row"
|
||||||
style={{
|
style={{
|
||||||
|
|||||||
Reference in new issue
Block a user