fix: only remove non-existed routes from tab history. closes #8567

This commit is contained in:
Satyajit Sahoo
2020-07-10 21:16:13 +02:00
parent 96c7b688ce
commit 374b081b1c

View File

@@ -244,8 +244,9 @@ export default function TabRouter({
routeNames.indexOf(state.routes[state.index].name)
);
let history = state.history.filter((it) =>
routes.find((r) => r.key === it.key)
let history = state.history.filter(
// Type will always be 'route' for tabs, but could be different in a router extending this (e.g. drawer)
(it) => it.type !== 'route' || routes.find((r) => r.key === it.key)
);
if (!history.length) {