Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
|
@@ -200,11 +200,10 @@ def get_current_map_data():
|
|
| 200 |
|
| 201 |
# Priority 1: Check uploaded files cache FIRST (regardless of session)
|
| 202 |
if UPLOADED_MAP_CACHE['nodes'] is not None:
|
| 203 |
-
#
|
| 204 |
-
ways =
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
print(f"✅ Using uploaded map cache (accidents: {ways is not None and any(w.get('accident', False) for w in ways)})")
|
| 208 |
return (
|
| 209 |
UPLOADED_MAP_CACHE['nodes'],
|
| 210 |
ways,
|
|
|
|
| 200 |
|
| 201 |
# Priority 1: Check uploaded files cache FIRST (regardless of session)
|
| 202 |
if UPLOADED_MAP_CACHE['nodes'] is not None:
|
| 203 |
+
# ALWAYS use cached ways (which includes accidents) - don't rely on session
|
| 204 |
+
ways = copy.deepcopy(UPLOADED_MAP_CACHE['ways'])
|
| 205 |
+
accidents_count = sum(1 for w in ways if w.get('accident', False))
|
| 206 |
+
print(f"✅ Using uploaded map cache (accidents applied: {accidents_count})")
|
|
|
|
| 207 |
return (
|
| 208 |
UPLOADED_MAP_CACHE['nodes'],
|
| 209 |
ways,
|