From 437401f731d58510bb8cb55322c96a1c42398588 Mon Sep 17 00:00:00 2001 From: efigueroa Date: Sat, 6 Sep 2025 23:23:03 -0700 Subject: [PATCH] Revert loading screen routes to fix hanging issue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Reverted / and // 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 --- app.py | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/app.py b/app.py index cb36a58..77f2c2e 100644 --- a/app.py +++ b/app.py @@ -104,14 +104,13 @@ def set_timezone(): @app.route('/') 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('//') 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('///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('///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"""