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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user