Skip to content

Commit

Permalink
Remove duplicate call to fetchStaticAdminMeta (#4885)
Browse files Browse the repository at this point in the history
* Remove duplicate call to fetchStaticAdminMeta, fixes #4828
  • Loading branch information
JedWatson authored Feb 18, 2021
1 parent dae6291 commit 9a9276e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/empty-ghosts-count.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@keystone-next/admin-ui": patch
---

Fixed an issue that would cause the Admin UI to get stuck in an infinite loop when loading adminMeta without a local cache
3 changes: 0 additions & 3 deletions packages-next/admin-ui/src/utils/useAdminMeta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ export function useAdminMeta(adminMetaHash: string, fieldViews: FieldViews) {
const [fetchStaticAdminMeta, { data, error, called }] = useLazyQuery(staticAdminMetaQuery, {
fetchPolicy: 'network-only',
});
if (typeof window !== 'undefined' && adminMetaFromLocalStorage === undefined && !called) {
fetchStaticAdminMeta();
}

let shouldFetchAdminMeta = adminMetaFromLocalStorage === undefined && !called;

Expand Down

1 comment on commit 9a9276e

@vercel
Copy link

@vercel vercel bot commented on 9a9276e Feb 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.