MCPcopy
hub / github.com/cpaczek/skylight / switchToProfile

Function switchToProfile

web/src/control/Control.tsx:98–99  ·  view source on GitHub ↗
(p: LocationProfile)

Source from the content-addressed store, hash-verified

96 const atCurrent = (p: { lat: number; lon: number }) =>
97 Math.abs(p.lat - cfg.centerLat) < 1e-4 && Math.abs(p.lon - cfg.centerLon) < 1e-4;
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 = {

Callers 1

ControlFunction · 0.85

Calls 1

setFunction · 0.85

Tested by

no test coverage detected