Revert loading screen routes to fix hanging issue
- Reverted /<username> and /<username>/<week> routes to original behavior - Loading screen was causing infinite hang due to routing issues - Kept caching improvements for better performance - App now works normally with fast cached API calls - Can implement progressive loading differently in future 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
1837590a79
commit
437401f731
1 changed files with 5 additions and 13 deletions
18
app.py
18
app.py
|
|
@ -104,14 +104,13 @@ def set_timezone():
|
|||
|
||||
@app.route('/<username>')
|
||||
def dashboard_current(username):
|
||||
"""Dashboard for current NFL week - shows loading state first"""
|
||||
"""Dashboard for current NFL week"""
|
||||
print(f"DEBUG: Dashboard current route - username: '{username}'", flush=True)
|
||||
try:
|
||||
nfl_state = sleeper_api.get_nfl_state()
|
||||
current_week = nfl_state.get('display_week', 1)
|
||||
print(f"DEBUG: Current week: {current_week}", flush=True)
|
||||
# Show loading state first for better UX
|
||||
return render_template('loading.html', username=username, week=current_week)
|
||||
return dashboard(username, current_week)
|
||||
except Exception as e:
|
||||
print(f"ERROR: dashboard_current exception - {str(e)}", flush=True)
|
||||
print(f"ERROR: Full traceback: {traceback.format_exc()}", flush=True)
|
||||
|
|
@ -120,22 +119,15 @@ def dashboard_current(username):
|
|||
|
||||
@app.route('/<username>/<int:week>')
|
||||
def dashboard_week(username, week):
|
||||
"""Dashboard for specific week - shows loading state first"""
|
||||
"""Dashboard for specific week"""
|
||||
print(f"DEBUG: Dashboard week - username: '{username}', week: {week}", flush=True)
|
||||
# Show loading state first for better UX
|
||||
return render_template('loading.html', username=username, week=week)
|
||||
|
||||
@app.route('/<username>/<int:week>/data')
|
||||
def dashboard_data(username, week):
|
||||
"""Dashboard data route - actual API calls and data loading"""
|
||||
print(f"DEBUG: Dashboard data route - username: '{username}', week: {week}", flush=True)
|
||||
return dashboard(username, week)
|
||||
|
||||
@app.route('/<username>/<int:week>/refresh', methods=['POST'])
|
||||
def refresh_scores(username, week):
|
||||
"""Server-side refresh scores - redirect back to dashboard data"""
|
||||
"""Server-side refresh scores - redirect back to dashboard"""
|
||||
print(f"DEBUG: Refresh scores POST - username: '{username}', week: {week}", flush=True)
|
||||
return redirect(url_for('dashboard_data', username=username, week=week))
|
||||
return redirect(url_for('dashboard_week', username=username, week=week))
|
||||
|
||||
def dashboard(username, week):
|
||||
"""Main dashboard logic - fetch and display user's fantasy data"""
|
||||
|
|
|
|||
Loading…
Reference in a new issue