()
| 98 | const switchToProfile = (p: LocationProfile) => |
| 99 | set({ centerLat: p.lat, centerLon: p.lon, radiusMiles: p.radiusMiles, locationName: p.name }); |
| 100 | const saveCurrentProfile = () => { |
| 101 | const name = cfg.locationName?.trim() || formatLatLon(cfg.centerLat, cfg.centerLon); |
| 102 | const profile: LocationProfile = { |
| 103 | id: genId(), |
| 104 | name, |
| 105 | lat: cfg.centerLat, |
| 106 | lon: cfg.centerLon, |
| 107 | radiusMiles: cfg.radiusMiles, |
| 108 | }; |
| 109 | // Replace any existing profile already saved at this spot. |
| 110 | const rest = cfg.locationProfiles.filter((p) => !atCurrent(p)); |
| 111 | set({ locationProfiles: [...rest, profile] }); |
| 112 | }; |
| 113 | const removeProfile = (id: string) => |
| 114 | set({ locationProfiles: cfg.locationProfiles.filter((p) => p.id !== id) }); |
| 115 | const centerOnTraffic = () => { |
nothing calls this directly
no test coverage detected