Skip to content

Commit

Permalink
[default-layout] Defer intent redirect to fix empty tool state (#1015)
Browse files Browse the repository at this point in the history
  • Loading branch information
rexxars authored and bjoerge committed Oct 16, 2018
1 parent dba8009 commit e5249d8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/@sanity/default-layout/src/datastores/urlState.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ function maybeHandleIntent(prevEvent, currentEvent) {
if (currentEvent && currentEvent.state && currentEvent.state.intent) {
const redirectState = resolveIntentState(prevEvent ? prevEvent.state : {}, currentEvent.state)
if (redirectState) {
navigate(rootRouter.encode(redirectState), {replace: true})
const newUrl = rootRouter.encode(redirectState)
setTimeout(() => navigate(newUrl, {replace: true}), 0)
return null
}
}
Expand Down

0 comments on commit e5249d8

Please sign in to comment.