Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,6 @@ async function removeMatch(id) {
toggleLoading(true);

try {
const match = state.matches.find(m => m.id === id);
await deleteMatch(id);

state.matches = state.matches.filter(m => m.id !== id);
Expand Down
4 changes: 4 additions & 0 deletions src/chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ export function renderEloChart(type = 'singles') {
.sort((a, b) => a[1].name.localeCompare(b[1].name));

if (activePlayers.length === 0) {
if (chartInstance) {
chartInstance.destroy();
chartInstance = null;
}
let msg = canvas.parentElement.querySelector('.chart-empty-msg');
if (!msg) {
msg = document.createElement('p');
Expand Down
20 changes: 16 additions & 4 deletions src/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,26 @@ export function persistMatches() {

export function loadLocalPlayers() {
const raw = localStorage.getItem('eloPlayers');
if (raw) state.players = JSON.parse(raw);
return !!raw;
if (!raw) return false;
try {
state.players = JSON.parse(raw);
return true;
} catch {
localStorage.removeItem('eloPlayers');
return false;
}
}

export function loadLocalMatches() {
const raw = localStorage.getItem('eloMatches');
if (raw) state.matches = JSON.parse(raw);
return !!raw;
if (!raw) return false;
try {
state.matches = JSON.parse(raw);
return true;
} catch {
localStorage.removeItem('eloMatches');
return false;
}
}

// ================= STATISTIK-NEUBERECHNUNG =================
Expand Down
Loading