diff --git a/app/routes/api.py b/app/routes/api.py index 5df0cbc..ce287c9 100644 --- a/app/routes/api.py +++ b/app/routes/api.py @@ -726,3 +726,17 @@ def register_api_routes(app, services, settings): updater._update_available = True return jsonify({'success': True, 'message': 'Update banner triggered'}) return jsonify({'success': False, 'error': 'Updater not available'}) + + @app.route('/api/update/check', methods=['POST']) + def api_update_check(): + """Force a fresh check against GitHub.""" + updater = services.get('updater') + if not updater: + return jsonify({'success': False, 'error': 'Updater not available'}) + updater.check_for_updates() + return jsonify({ + 'available': updater.update_available, + 'status': updater.update_status, + 'local_sha': updater._current_sha, + 'remote_sha': updater._latest_sha, + }) diff --git a/templates/base.html b/templates/base.html index 378deeb..438e1c4 100644 --- a/templates/base.html +++ b/templates/base.html @@ -57,7 +57,7 @@ btn.textContent = 'Checking...'; btn.disabled = true; try { - const resp = await fetch('/api/update/status'); + const resp = await fetch('/api/update/check', { method: 'POST' }); const data = await resp.json(); if (data.available) { document.getElementById('update-banner').style.display = 'flex';