chore: call refresh after the subscription is ready, fixes CI (#7542)

LivePreview data was stale if the user entered data while the socket
connection was being established. This change ensures fresh data is
fetched after the connection is established.

This is easy to see when turning on 4G connection and in CI, where it is
especially slow.
This commit is contained in:
Jarrod Flesch
2024-08-06 12:17:50 -04:00
committed by GitHub
parent f2b8ddb299
commit e8bed7b315
2 changed files with 6 additions and 3 deletions

View File

@@ -1,10 +1,10 @@
import type { Where } from 'payload'
import type { CollectionSlug, Where } from 'payload'
import config from '@payload-config'
import { getPayloadHMR } from '@payloadcms/next/utilities/getPayloadHMR.js'
export const getDoc = async <T>(args: {
collection: string
collection: CollectionSlug
depth?: number
draft?: boolean
slug?: string