Skip to content

Commit

Permalink
Fix crash when spaming navbar button + Last Match auth msg
Browse files Browse the repository at this point in the history
  • Loading branch information
yohkaz committed Dec 5, 2020
1 parent eaf97a9 commit 0a4ab72
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 8 deletions.
2 changes: 2 additions & 0 deletions src/fortnite_noss.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ def get_last_replay_data(self):

players_by_id = self.fortnite_replay.extract_players(self.last_replay)
players_ids_usernames = self.fortnitewebapi.multiple_players_by_id(list(players_by_id.keys()))
if players_ids_usernames is None:
return None

data = {}
# Filename
Expand Down
2 changes: 1 addition & 1 deletion src/gui/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ml-auto">
<li class="nav-item active">
<a class="nav-link" href="">About <span class="sr-only">(current)</span></a>
<a class="nav-link" href="#">About <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="auth.html">Authentication</a>
Expand Down
2 changes: 1 addition & 1 deletion src/gui/auth.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
<a class="nav-link" href="about.html">About</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="">Authentication <span class="sr-only">(current)</span></a>
<a class="nav-link" href="#">Authentication <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="tracker.html">Tracker</a>
Expand Down
21 changes: 17 additions & 4 deletions src/gui/last_match.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@

<script type="text/javascript">
window.resizeTo(780, 960);

async function checkAuthStatus() {
var auth_status = await eel.fortnitewebapi_status()();
if (auth_status) {
document.getElementById("playersListButton").disabled = false;
document.getElementById("killfeedButton").disabled = false;
} else {
document.getElementById("authStatusMsg").textContent = 'Authentication required!';
}
}
checkAuthStatus();

async function initDatatable() {
var last_replay_data = await eel.get_last_replay_data()();
if (!last_replay_data) {
Expand Down Expand Up @@ -102,7 +114,7 @@
<a class="nav-link" href="tracker.html">Tracker</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="">Last Match <span class="sr-only">(current)</span></a>
<a class="nav-link" href="#">Last Match <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="settings.html">Settings</a>
Expand All @@ -113,12 +125,13 @@

<div class="text-center mt-4 mb-5">
<label class="h6 mb-4">
Last Match Details
Last Match Details<br />
<small class="text-muted font-weight-bold" id="authStatusMsg"></small>
</label><br />
<button type="button" class="btn btn-info" onclick="showPlayersList()">
<button type="button" id="playersListButton" class="btn btn-info" onclick="showPlayersList()" disabled>
Players List
</button>
<button type="button" class="btn btn-info" onclick="showKillfeed()">
<button type="button" id="killfeedButton" class="btn btn-info" onclick="showKillfeed()" disabled>
Killfeed
</button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/gui/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
<a class="nav-link" href="last_match.html">Last Match</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="">Settings <span class="sr-only">(current)</span></a>
<a class="nav-link" href="#">Settings <span class="sr-only">(current)</span></a>
</li>
</ul>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/gui/tracker.html
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@
<a class="nav-link" href="auth.html">Authentication</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="">Tracker <span class="sr-only">(current)</span></a>
<a class="nav-link" href="#">Tracker <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="last_match.html">Last Match</a>
Expand Down

0 comments on commit 0a4ab72

Please sign in to comment.