catalog-react: improve comment
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
This commit is contained in:
@@ -29,9 +29,10 @@ export function useOwnedEntitiesCount() {
|
||||
const catalogApi = useApi(catalogApiRef);
|
||||
|
||||
const { filters } = useEntityList();
|
||||
// Trigger load only on mount
|
||||
|
||||
const { value: ownershipEntityRefs, loading: loadingEntityRefs } = useAsync(
|
||||
async () => (await identityApi.getBackstageIdentity()).ownershipEntityRefs,
|
||||
// load only on mount
|
||||
[],
|
||||
);
|
||||
|
||||
|
||||
@@ -41,10 +41,14 @@ export function useEntityOwnership(): {
|
||||
const identityApi = useApi(identityApiRef);
|
||||
|
||||
// Trigger load only on mount
|
||||
const { loading, value: refs } = useAsync(async () => {
|
||||
const { ownershipEntityRefs } = await identityApi.getBackstageIdentity();
|
||||
return ownershipEntityRefs;
|
||||
}, []);
|
||||
const { loading, value: refs } = useAsync(
|
||||
async () => {
|
||||
const { ownershipEntityRefs } = await identityApi.getBackstageIdentity();
|
||||
return ownershipEntityRefs;
|
||||
},
|
||||
// load only on mount
|
||||
[],
|
||||
);
|
||||
|
||||
const isOwnedEntity = useMemo(() => {
|
||||
const myOwnerRefs = new Set(refs ?? []);
|
||||
|
||||
Reference in New Issue
Block a user