Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix asset type selection #4681

Merged
merged 2 commits into from
Feb 25, 2022
Merged

Fix asset type selection #4681

merged 2 commits into from
Feb 25, 2022

Conversation

aptkingston
Copy link
Member

Description

This is a quick fix for #4075. The real issue was that whenever no assets of a certain type exist (for example when you have no screens in a fresh app), and you click on layouts and then back to screens, state was not update as a valid screen could not be found. This mean that the client preview never changed. The logic that normally updates state is inside packages/builder/src/pages/builder/app/[application]/design/[assetType]/index.svelte.

The issue was compounded with the fact that client app previews inside the builder did not always remount properly, if you toggled between a layout and a screen that shared the same layout ID. This PR fixes this by adding the current builder preview asset type to the keying of the rendering of the layout. This is fine for production apps too as this string will always just evaluate to null.

@aptkingston aptkingston merged commit 69548f9 into develop Feb 25, 2022
@aptkingston aptkingston deleted the fix/asset-type-selection branch February 25, 2022 13:38
@github-actions github-actions bot locked and limited conversation to collaborators Feb 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant