Skip to content

Commit

Permalink
fix: relanch logic change for fix #6733
Browse files Browse the repository at this point in the history
  • Loading branch information
ZakaryCode committed Aug 13, 2020
1 parent 751f52a commit 440be56
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/taro-router/src/apis/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,10 @@ const createReLaunch = ({ customRoutes }: RouterConfig, history?: History) => {
res.errMsg = 'reLaunch:ok'
resolve(res)
}, 50)
if (history) {
const key = window.history.state.key * 1
if (key > 0) {
window.history.go(-key)
} else if (history) {
history.go(-(history.length - 1))
} else {
window.history.go(-(window.history.length - 1))
Expand Down

0 comments on commit 440be56

Please sign in to comment.