Skip to content

Commit

Permalink
Merge pull request #229 from fleizean/spa
Browse files Browse the repository at this point in the history
Update 404 page and navigation.js to handle 404 errors
  • Loading branch information
temasictfic committed Apr 20, 2024
2 parents d29c902 + ec71279 commit dc1f7c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion indianpong/pong/templates/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

{% block app %}
<div class="HeaderArea" id="HeaderArea">
<div class="big-text">{{context.notFoundHeaderText}}</div>
<div class="big-text">404 ERROR</div>
<div class="small-text">{{context.notFoundSubHeaderText}}</div>
<div class="gohome-button-container">
<a onclick="swapApp('/')"><button class="gohome-button" type="button">
Expand Down
4 changes: 3 additions & 1 deletion indianpong/static/js/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ function updateApp(path) {
.then(response => response.text())
.then(html => {
document.body.innerHTML = html;
pageHandler(path);
if (!html.includes('<div class="big-text">404 ERROR</div>')) {
pageHandler(path);
}
hideLoadingScreen();
})
.catch(error => console.error(error));
Expand Down

0 comments on commit dc1f7c7

Please sign in to comment.