saving issue fixed

This commit is contained in:
bl3kunja-FW
2025-11-11 17:34:42 +01:00
parent 23dc5673ee
commit fd44ca7128
4 changed files with 58 additions and 24 deletions
+18 -2
View File
@@ -1305,10 +1305,26 @@
if (response.ok) {
const responseData = await response.json();
// Always show results first when tournament finishes
// Determine where to redirect based on tournament type and archive
let redirectUrl = '/results';
// Priority 1: If league finished, redirect to league archive
if (responseData.league_archived && responseData.league_archive_filename) {
redirectUrl = `/archive/league/${responseData.league_archive_filename}`;
}
// Priority 2: If standalone tournament, redirect to tournament archive
else if (responseData.archived && responseData.archive_filename) {
redirectUrl = `/archive/tournament/${responseData.archive_filename}`;
}
// Priority 3: If league tournament (not final), show league standings
else if (responseData.league && !responseData.league_finished) {
redirectUrl = '/results'; // This will show league standings with current tournament
}
// Always show results after tournament finishes
alert('Tournament finished successfully! Showing results...');
setTimeout(() => {
window.location.href = '/results';
window.location.href = redirectUrl;
}, 1000);
} else {
const error = await response.json();