saving issue fixed
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user