-
Notifications
You must be signed in to change notification settings - Fork 169
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
两层以上的ChildAction里发生global redirect的时候会报错 #152
Comments
Fix in #152 |
好像还有点问题,看逻辑 |
昨晚改成了 |
全集在meta/RedirectOption里有写 Best regards Gray Zhang 在 2015年1月20日 上午10:58:50, chestnut (notifications@github.com) 写到: 昨晚改成了redirectType还没提交,再看看data-redirect的全集都有哪些 — |
@otakustay meta 里面好像漏了 global,还有这里是不是多传了一个 |
是的,在PR中一并给我吧 |
hijack
里边会判断是不是子childAction
已经做过处理了,但是其实如果是global redirect
的话,肯定是处理过的。所以可以加上判断是否是global redirect
,是就不用去检查子childAction
是否处理过。报错的原因是,
childAction
在global redirect
的时候会同步把自己的容器销毁,然后再上层的Action
在第二次hijack
的时候又检查isChildActionRedirected
。虽然容器在内存中的片段还可以访问,但是到innermostContainer
是该容器的时候,innermostContainer.parentNode
就是null
了,所以if (innermostContainer.id !== actionContext.container) {
就报错了还有个小问题就是
hijack
里边的会产生一个对象
{"": true}
解决方案可以是
innermostContainer && innermostContainer.id !== actionContext.container
或者提前判断global redirect
,感觉提前判断global redirect
会好一点The text was updated successfully, but these errors were encountered: