mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Show upgradable packages only when checking for updates (#4599)
* Sort upgradable packages to top * Show upgradable packages only by default * Fix loading state when refetching
This commit is contained in:
@@ -2,6 +2,7 @@ import {
|
||||
ApolloCache,
|
||||
DocumentNode,
|
||||
FetchResult,
|
||||
NetworkStatus,
|
||||
useQuery,
|
||||
} from "@apollo/client";
|
||||
import { Modifiers } from "@apollo/client/cache";
|
||||
@@ -93,6 +94,16 @@ function deleteObject(
|
||||
cache.evict({ id: cache.identify(obj) });
|
||||
}
|
||||
|
||||
export function isLoading(networkStatus: NetworkStatus) {
|
||||
// useQuery hook loading field only returns true when initially loading the query
|
||||
// and not during subsequent fetches
|
||||
return (
|
||||
networkStatus === NetworkStatus.loading ||
|
||||
networkStatus === NetworkStatus.fetchMore ||
|
||||
networkStatus === NetworkStatus.refetch
|
||||
);
|
||||
}
|
||||
|
||||
/// Object queries
|
||||
|
||||
export const useFindScene = (id: string) => {
|
||||
|
||||
Reference in New Issue
Block a user