Skip to content

Commit

Permalink
Remove unnecessary exports
Browse files Browse the repository at this point in the history
  • Loading branch information
Eddasol committed Nov 12, 2024
1 parent a3b9c77 commit cbf6ada
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion frontend/src/api/ApiError.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CustomError } from 'ts-custom-error'

export const StatusTexts: { [key: number]: string } = {
const StatusTexts: { [key: number]: string } = {
400: 'Bad Request',
401: 'Unauthorized', // RFC 7235
402: 'Payment Required',
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Contexts/AlertContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const defaultAlertInterface = {
clearListAlert: (source: AlertType) => {},
}

export const AlertContext = createContext<IAlertContext>(defaultAlertInterface)
const AlertContext = createContext<IAlertContext>(defaultAlertInterface)

export const AlertProvider: FC<Props> = ({ children }) => {
const [alerts, setAlerts] = useState<AlertDictionaryType>(defaultAlertInterface.alerts)
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Contexts/LanguageContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const defaultLanguageInterface = {
TranslateText: (str: string) => '',
}

export const LanguageContext = createContext<ILanguageContext>(defaultLanguageInterface)
const LanguageContext = createContext<ILanguageContext>(defaultLanguageInterface)

export const LanguageProvider: FC<Props> = ({ children }) => {
const prevLanguage = window.localStorage.getItem('flotilla-language')
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Contexts/MediaStreamContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const defaultMediaStreamInterface = {
mediaStreams: {},
}

export const MediaStreamContext = createContext<IMediaStreamContext>(defaultMediaStreamInterface)
const MediaStreamContext = createContext<IMediaStreamContext>(defaultMediaStreamInterface)

export const MediaStreamProvider: FC<Props> = ({ children }) => {
const [mediaStreams, setMediaStreams] = useState<MediaStreamDictionaryType>(
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/Contexts/MissionControlContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface Props {
children: React.ReactNode
}

export interface IMissionControlContext {
interface IMissionControlContext {
missionControlState: IMissionControlState
updateRobotMissionState: (newState: MissionStatusRequest, robotId: string) => void
}
Expand All @@ -25,7 +25,7 @@ const defaultMissionControlInterface = {
updateRobotMissionState: (newState: MissionStatusRequest, robotId: string) => {},
}

export const MissionControlContext = createContext<IMissionControlContext>(defaultMissionControlInterface)
const MissionControlContext = createContext<IMissionControlContext>(defaultMissionControlInterface)
const defaultManagementState: IMissionControlState = {
isRobotMissionWaitingForResponseDict: {},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const defaultMissionDefinitionsContext: IMissionDefinitionsContext = {
missionDefinitions: [],
}

export const MissionDefinitionsContext = createContext<IMissionDefinitionsContext>(defaultMissionDefinitionsContext)
const MissionDefinitionsContext = createContext<IMissionDefinitionsContext>(defaultMissionDefinitionsContext)

const upsertMissionDefinition = (oldQueue: MissionDefinition[], updatedMission: MissionDefinition) => {
const oldQueueCopy = [...oldQueue]
Expand All @@ -39,7 +39,7 @@ const fetchMissionDefinitions = (params: {
orderBy: string
}): Promise<MissionDefinition[]> => BackendAPICaller.getMissionDefinitions(params).then((response) => response.content)

export const useMissionDefinitions = (): IMissionDefinitionsContext => {
const useMissionDefinitions = (): IMissionDefinitionsContext => {
const [missionDefinitions, setMissionDefinitions] = useState<MissionDefinition[]>([])
const { registerEvent, connectionReady } = useSignalRContext()
const { installationCode } = useInstallationContext()
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Contexts/MissionFilterContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const defaultMissionFilterInterface: IMissionFilterContext = {
},
}

export const MissionFilterContext = createContext<IMissionFilterContext>(defaultMissionFilterInterface)
const MissionFilterContext = createContext<IMissionFilterContext>(defaultMissionFilterInterface)

export const MissionFilterProvider: FC<Props> = ({ children }) => {
const { TranslateText } = useLanguageContext()
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/Contexts/MissionRunsContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const defaultMissionRunsContext: IMissionRunsContext = {
setLoadingMissionSet: (newLoadingMissionSet: Set<string> | ((mission: Set<string>) => Set<string>)) => {},
}

export const MissionRunsContext = createContext<IMissionRunsContext>(defaultMissionRunsContext)
const MissionRunsContext = createContext<IMissionRunsContext>(defaultMissionRunsContext)

const updateQueueIfMissionAlreadyQueued = (oldQueue: Mission[], updatedMission: Mission) => {
const existingMissionIndex = oldQueue.findIndex((m) => m.id === updatedMission.id)
Expand Down Expand Up @@ -76,7 +76,7 @@ const fetchMissionRuns = (params: {
orderBy: string
}): Promise<Mission[]> => BackendAPICaller.getMissionRuns(params).then((response) => response.content)

export const useMissionRuns = (): IMissionRunsContext => {
const useMissionRuns = (): IMissionRunsContext => {
const [ongoingMissions, setOngoingMissions] = useState<Mission[]>([])
const [missionQueue, setMissionQueue] = useState<Mission[]>([])
const [loadingMissionSet, setLoadingMissionSet] = useState<Set<string>>(new Set())
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/Contexts/RobotContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ interface Props {
children: React.ReactNode
}

export interface IRobotContext {
interface IRobotContext {
enabledRobots: Robot[]
}

const defaultRobotState = {
enabledRobots: [],
}

export const RobotContext = createContext<IRobotContext>(defaultRobotState)
const RobotContext = createContext<IRobotContext>(defaultRobotState)

export const RobotProvider: FC<Props> = ({ children }) => {
const [enabledRobots, setEnabledRobots] = useState<Robot[]>(defaultRobotState.enabledRobots)
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Contexts/SignalRContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const defaultSignalRInterface = {

const URL = config.BACKEND_API_SIGNALR_URL

export const SignalRContext = createContext<ISignalRContext>(defaultSignalRInterface)
const SignalRContext = createContext<ISignalRContext>(defaultSignalRInterface)

export const SignalRProvider: FC<Props> = ({ children }) => {
const [connection, setConnection] = useState<signalR.HubConnection | undefined>(defaultSignalRInterface.connection)
Expand Down

0 comments on commit cbf6ada

Please sign in to comment.