Required for #13005. Opening an autosave-enabled document within a drawer triggers an infinite loop when the root document is also autosave-enabled. This was for two reasons: 1. Autosave would run and change the `updatedAt` timestamp. This would trigger another run of autosave, and so on. The timestamp is now removed before comparison to ensure that sequential autosave runs are skipped. 2. The `dequal()` call was not being given the `.current` property off the ref object. This meant that is was never evaluate to `true` and therefore never skip unnecessary autosaves to begin with. --- - To see the specific tasks where the Asana app for GitHub is being used, see below: - https://app.asana.com/0/0/1210697235723932
53 lines
1.5 KiB
TypeScript
53 lines
1.5 KiB
TypeScript
export const autosaveCollectionSlug = 'autosave-posts'
|
|
|
|
export const autosaveWithDraftButtonSlug = 'autosave-with-draft-button-posts'
|
|
|
|
export const autosaveWithDraftValidateSlug = 'autosave-with-validate-posts'
|
|
|
|
export const customIDSlug = 'custom-ids'
|
|
|
|
export const draftCollectionSlug = 'draft-posts'
|
|
|
|
export const draftWithValidateCollectionSlug = 'draft-with-validate-posts'
|
|
export const draftWithMaxCollectionSlug = 'draft-with-max-posts'
|
|
|
|
export const postCollectionSlug = 'posts'
|
|
|
|
export const diffCollectionSlug = 'diff'
|
|
export const mediaCollectionSlug = 'media'
|
|
export const media2CollectionSlug = 'media2'
|
|
|
|
export const versionCollectionSlug = 'version-posts'
|
|
|
|
export const disablePublishSlug = 'disable-publish'
|
|
export const errorOnUnpublishSlug = 'error-on-unpublish'
|
|
|
|
export const disablePublishGlobalSlug = 'disable-publish-global'
|
|
|
|
export const textCollectionSlug = 'text'
|
|
|
|
export const collectionSlugs = [
|
|
autosaveCollectionSlug,
|
|
draftCollectionSlug,
|
|
postCollectionSlug,
|
|
diffCollectionSlug,
|
|
mediaCollectionSlug,
|
|
media2CollectionSlug,
|
|
versionCollectionSlug,
|
|
textCollectionSlug,
|
|
]
|
|
|
|
export const autoSaveGlobalSlug = 'autosave-global'
|
|
|
|
export const autosaveWithDraftButtonGlobal = 'autosave-with-draft-button-global'
|
|
|
|
export const draftGlobalSlug = 'draft-global'
|
|
|
|
export const draftWithMaxGlobalSlug = 'draft-with-max-global'
|
|
|
|
export const globalSlugs = [autoSaveGlobalSlug, draftGlobalSlug]
|
|
|
|
export const localizedCollectionSlug = 'localized-posts'
|
|
|
|
export const localizedGlobalSlug = 'localized-global'
|