Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: prevent flash of "Untitled" when loading a document w/ preview #7505

Merged
merged 2 commits into from
Sep 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
})
}
// React to changes in hasRev only
// eslint-disable-next-line react-hooks/exhaustive-deps

Check warning on line 119 in packages/sanity/src/structure/panes/document/documentPanel/documentViews/FormView.tsx

View workflow job for this annotation

GitHub Actions / lint

React Compiler has skipped optimizing this component because one or more React ESLint rules were disabled. React Compiler only works when your components follow all the rules of React, disabling them may result in unexpected or incorrect behavior
}, [hasRev])

const [formRef, setFormRef] = useState<null | HTMLDivElement>(null)
Expand Down Expand Up @@ -166,7 +166,7 @@
>
<PresenceOverlay margins={margins}>
<Box as="form" onSubmit={preventDefault} ref={setRef}>
{connectionState === 'connecting' ? (
{connectionState === 'connecting' || !ready ? (
<Delay ms={300}>
{/* TODO: replace with loading block */}
<Flex align="center" direction="column" height="fill" justify="center">
Expand Down
Loading