Skip to content

Conversation

fgnass
Copy link
Contributor

@fgnass fgnass commented Feb 25, 2025

This PR fixes the warnings React logs to the console when an asset preview is shown for the first time (see #7414).

The issue is caused because getAsset dispatches an action, which in turn triggers a state update. I haven't done any Redux in a while, so there might be better patterns to fix this, but this at least does the trick.

While fixing this, I stumbled over two other problems in the console logs:

  1. A PropType warning regarding ObjectPreview.field: This is declared as Node, but in reality an immutable map is passed.
  2. A 404 error when trying to load assets while visualEditing is turned on. I filed this as Error: Visual editing breaks image previews #7415 and included a quick fix here that simply disables visualEditing for the posts collection in dev-test.

@fgnass fgnass requested a review from a team as a code owner February 25, 2025 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants