Skip to content

Commit

Permalink
Update 404 page and navigation.js to handle 404 errors
Browse files Browse the repository at this point in the history
Co-authored-by: Enes Yağız <fleizean@users.noreply.github.com>
  • Loading branch information
temasictfic and fleizean committed Apr 20, 2024
1 parent aaba7b5 commit ec71279
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 ec71279

Please sign in to comment.