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(default-layout): respect space redirect on initial load #2874

Merged
merged 1 commit into from
Oct 18, 2021

Conversation

rexxars
Copy link
Member

@rexxars rexxars commented Oct 18, 2021

Description

When the router redirects, a change event is emitted instead of a snapshot event, which caused the reconfiguration of the client not to be triggered. This PR makes sure that both snapshot and change events are treated equally when setting the client configuration.

Notes for release

  • Fixes a bug where if a space was configured as the default but not the first in the spaces array, the initial studio load would redirect to the correct URL but not configure the client to use the correct dataset

@vercel
Copy link

vercel bot commented Oct 18, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

perf-studio – ./

🔍 Inspect: https://vercel.com/sanity-io/perf-studio/JoNCDRdXLN9yCFQMLZPV3TZ3hoTC
✅ Preview: https://perf-studio-git-fix-spaces-default.sanity.build

test-studio – ./

🔍 Inspect: https://vercel.com/sanity-io/test-studio/66QtRHJJ2d7UyuwVJBHcUDiwLbiz
✅ Preview: https://test-studio-git-fix-spaces-default.sanity.build

studio-workshop – ./dev/workshop

🔍 Inspect: https://vercel.com/sanity-io/studio-workshop/8cKM6eWvwa7UYpq7FXzDwkdMLAbs
✅ Preview: https://studio-workshop-git-fix-spaces-default.sanity.build

When the router redirects, a `change` event is emitted instead of a
`snapshot` event, which caused the reconfiguration of the client not to
be triggered. This PR makes sure that both snapshot and change events are
treated equally when setting the client configuration.

Fixes [sc-11974]
Copy link
Member

@bjoerge bjoerge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch! 👏🏼

@rexxars rexxars merged commit a8656fd into next Oct 18, 2021
@rexxars rexxars deleted the fix/spaces-default branch October 18, 2021 14:33
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.

None yet

2 participants