From e8d28f40c2d1f08e59a6e2d923838e3ec56ad00c Mon Sep 17 00:00:00 2001 From: Thibault Camlane Date: Tue, 15 Jul 2025 10:00:41 +0200 Subject: [PATCH] correcting typo --- .../_PassOverFeat/SatellitePassOverLocation.tsx | 2 +- frontend/src/lib/store.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/satelliteData/_PassOverFeat/SatellitePassOverLocation.tsx b/frontend/src/components/satelliteData/_PassOverFeat/SatellitePassOverLocation.tsx index 836e5d4..1507952 100644 --- a/frontend/src/components/satelliteData/_PassOverFeat/SatellitePassOverLocation.tsx +++ b/frontend/src/components/satelliteData/_PassOverFeat/SatellitePassOverLocation.tsx @@ -30,7 +30,7 @@ export default function SatellitePassOverLocation() { const [latitude, setLatitude] = useState(""); const [longitude, setLongitude] = useState(""); const [error, setError] = useState(""); - const locations = useLocationStore((state) => state.locations); + const locations = useLocationStore((state) => state.location); const addLocation = useLocationStore((state) => state.addLocation); const setSelectedLocation = useLocationStore( (state) => state.setSelectedLocation, diff --git a/frontend/src/lib/store.ts b/frontend/src/lib/store.ts index 8c63e45..f207220 100644 --- a/frontend/src/lib/store.ts +++ b/frontend/src/lib/store.ts @@ -88,7 +88,7 @@ export const useSatelliteStore = create()((set) => ({ // Define the state for location management, for the pass over feature export interface LocationState { - locations: Location[]; + location: Location[]; selectedLocation: Location | null; } @@ -96,7 +96,7 @@ export interface LocationState { /* eslint-disable no-unused-vars */ // Disable unused variables as the store actions defined here are used in other files, export interface LocationActions { - setLocations: (locations: Location[]) => void; + setLocations: (location: Location[]) => void; addLocation: (location: Location) => void; setSelectedLocation: (location: Location) => void; } @@ -105,7 +105,7 @@ export interface LocationActions { export type LocationStore = LocationState & LocationActions; // Create location store export const useLocationStore = create()((set) => ({ - locations: [ + location: [ { latitude: 63.446827, longitude: 10.421906, @@ -119,8 +119,8 @@ export const useLocationStore = create()((set) => ({ name: "Trondheim", }, - setLocations: (locations) => set({ locations }), + setLocations: (location) => set({ location }), addLocation: (location) => - set((state) => ({ locations: [...state.locations, location] })), + set((state) => ({ location: [...state.location, location] })), setSelectedLocation: (location) => set({ selectedLocation: location }), }));