1
0
Fork 0
mirror of synced 2024-10-01 09:38:55 +13:00

routing breaks when we click same link twice #422

This commit is contained in:
Michael Shanks 2020-07-07 10:48:24 +01:00
parent 9098858ef8
commit 921c205e22
2 changed files with 5 additions and 3 deletions

View file

@ -99,7 +99,9 @@ const areTreeNodesEqual = (children1, children2) => {
let isEqual = false
for (let i = 0; i < children1.length; i++) {
isEqual = deepEqual(children1[i].context, children2[i].context)
isEqual =
deepEqual(children1[i].context, children2[i].context) &&
areTreeNodesEqual(children1[i].children, children2[i].children)
if (!isEqual) return false
if (isScreenSlot(children1[i].parentNode.props._component)) {
isEqual = deepEqual(children1[i].props, children2[i].props)

View file

@ -78,13 +78,13 @@ export const createTreeNode = () => ({
get destroy() {
const node = this
return () => {
if (node.unsubscribe) node.unsubscribe()
if (node.component && node.component.$destroy) node.component.$destroy()
if (node.children) {
for (let child of node.children) {
child.destroy()
}
}
if (node.unsubscribe) node.unsubscribe()
if (node.component && node.component.$destroy) node.component.$destroy()
for (let onDestroyItem of node.onDestroy) {
onDestroyItem()
}