Refresh the page automatically after a pending offline sync completes

The real dashboard is server-rendered before any client JS runs, so
the first page load after reconnecting always reflects the pre-sync
database state -- the background sync then completes silently, but
nothing told that already-rendered page to update. A task created
offline would appear to vanish until the next navigation happened to
load fresh data. runBackgroundSync() now reports whether it pushed
pending changes, and both places that trigger it automatically reload
the page when it did.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Keith Smith
2026-09-05 00:05:27 -06:00
co-authored by Claude Sonnet 5
parent a6f227e931
commit ae9ab596bb
3 changed files with 21 additions and 8 deletions
+2 -2
View File
@@ -148,8 +148,8 @@
{% endblock %}
<script src="{% static 'js/offline-db.js' %}?v=7"></script>
<script src="{% static 'js/offline-sync.js' %}?v=7"></script>
<script src="{% static 'js/app.js' %}?v=7"></script>
<script src="{% static 'js/offline-sync.js' %}?v=8"></script>
<script src="{% static 'js/app.js' %}?v=8"></script>
{% block extra_js %}{% endblock %}
</body>
</html>