Skip to content

Commit

Permalink
Merge pull request #29 from a-ignatov-parc/redirect-fix
Browse files Browse the repository at this point in the history
Fixed navigation redirects
  • Loading branch information
a-ignatov-parc committed Apr 3, 2018
2 parents 2b7dee6 + 9a19306 commit fe66b7e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,10 @@ export function render(renderFactory) {
}
} else if (!document.isAttached) {
if (redirect) {
const index = navigationDocument.documents.indexOf(document);
const prevDocument = navigationDocument.documents[index - 1];
const lastDocument = navigationDocument.documents.pop();

if (prevDocument) {
navigationDocument.replaceDocument(document, prevDocument);
if (lastDocument) {
navigationDocument.replaceDocument(document, lastDocument);
}
} else {
navigationDocument.pushDocument(document);
Expand Down

0 comments on commit fe66b7e

Please sign in to comment.