Skip to content

Commit

Permalink
Add loading state for edit StackPage in PagesPage (#1715)
Browse files Browse the repository at this point in the history
Add loading state for edit `StackPage` in `PagesPage`

Prevents flash of "Document not found" error message when reloading the
page editor

---

Previously:



https://github.com/vivid-planet/comet/assets/13380047/8f401034-f5a3-40df-a52e-7039a936cef7


Now:



https://github.com/vivid-planet/comet/assets/13380047/ac68b2ca-71b3-4c9e-9a9f-676dfb189b2b


---

Closes COM-469
  • Loading branch information
thomasdax98 authored Feb 20, 2024
1 parent 86cd5c6 commit 693cbdb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .changeset/pink-rules-promise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@comet/cms-admin": patch
---

Add loading state for edit `StackPage` in `PagesPage`

Prevents flash of "Document not found" error message when reloading the page editor
4 changes: 4 additions & 0 deletions packages/admin/cms-admin/src/pages/pagesPage/PagesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@ export function PagesPage({
{(selectedId) => {
const page = data?.pages.find((page) => page.id == selectedId);

if (loading) {
return <Loading behavior="fillPageHeight" />;
}

if (!page) {
return (
<MainContent>
Expand Down

0 comments on commit 693cbdb

Please sign in to comment.