Skip to content
Merged
Show file tree
Hide file tree
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
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Forms: improve loading state to show spinner immediately when data hasn't loaded.
6 changes: 4 additions & 2 deletions projects/packages/forms/src/dashboard/hooks/use-inbox-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export default function useInboxData(): UseInboxDataReturn {

const {
records: rawRecords,
isResolving: isLoadingRecordsData,
hasResolved,
totalItems,
totalPages,
} = useEntityRecords( 'postType', 'feedback', {
Expand Down Expand Up @@ -131,12 +131,14 @@ export default function useInboxData(): UseInboxDataReturn {
[ countsQueryParams ]
);

const isLoadingData = ! rawRecords?.length && ! hasResolved;

return {
totalItemsInbox,
totalItemsSpam,
totalItemsTrash,
records,
isLoadingData: isLoadingRecordsData,
isLoadingData,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there anything I need to do to see/duplicate the 'flash' issue? I'd like to confirm the issue before testing the fix, but I don't typically see a flash when the form responses page loads.

totalItems,
totalPages,
selectedResponsesCount,
Expand Down
Loading