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:
WithoutPants
2024-02-21 08:24:18 +11:00
committed by GitHub
parent 76e5598876
commit 5bb9bf902c
5 changed files with 84 additions and 14 deletions

View File

@@ -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) => {