Skip to content

Commit

Permalink
Revert "add back button to summary page"
Browse files Browse the repository at this point in the history
This reverts commit 7e32608.
  • Loading branch information
emilyjevans committed Jun 12, 2024
1 parent a91a9a3 commit 88198d6
Showing 1 changed file with 0 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,27 +62,8 @@ export class SummaryPageController extends PageController {
return this.makePostRouteHandler()(request, h);
}
const state = await cacheService.getState(request);
const progress = state.progress || [];
const currentPath = `/${this.model.basePath}${this.path}${request.url.search}`;

const viewModel = new SummaryViewModel(this.title, model, state, request);

/**
* used for when a user clicks the "back" link. Progress is stored in the state. This is a safer alternative to running javascript that pops the history `onclick`.
*/
const lastVisited = progress[progress.length - 1];
if (!lastVisited || !lastVisited.startsWith(currentPath)) {
if (progress[progress.length - 2] === currentPath) {
progress.pop();
} else {
progress.push(currentPath);
}
}

await cacheService.mergeState(request, { progress });

viewModel.backLink = progress[progress.length - 2];

if (viewModel.endPage) {
return redirectTo(
request,
Expand Down

0 comments on commit 88198d6

Please sign in to comment.