Add comment to highlight difference between previewing in v1 and v2 editors (#5894)

A follow-up to https://github.com/thepracticaldev/dev.to/pull/5873.
This commit is contained in:
Vaidehi Joshi 2020-02-04 08:32:06 -08:00 committed by GitHub
parent 79ff4cbd19
commit b09a0c60f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -29,6 +29,10 @@ function titleArea(previewResponse, version, articleState) {
});
}
// The v2 editor stores its cover image in articleState.mainImage, while the v1 editor
// stores it as previewRespose.cover_image. When previewing, we handle both by
// defaulting to setting the cover image to the mainImage on the article (v2),
// and only using the cover image from the previewResponse if it exists (v1).
let coverImage = articleState.mainImage || '';
if (articleState.previewShowing) {
// In preview state, use the cover_image from previewResponse.