misc fixes

This commit is contained in:
2025-11-29 12:59:56 -06:00
parent a4fdd93ede
commit 5100a93659
29 changed files with 124 additions and 476 deletions

View File

@@ -12,6 +12,7 @@ const Flights = () => {
const { logs, logsLoading } = useLogs();
useEffect(() => {
const flights: LogbookEntry[] | undefined = logs?.filter((log: LogbookEntry) => {
if (log.tracks && log.tracks.length > 0) {
return log;
@@ -25,10 +26,6 @@ const Flights = () => {
dispatch({ type: 'SET_ALERT', payload: { severity: 'default', message: 'No flights found' }})
}
}, [logs])
useEffect(() => {
console.log(logsLoading)
}, [logsLoading])
return (
<div className='max-w-screen-lg mx-auto'>

View File

@@ -508,7 +508,6 @@ const Logbook: React.FC<unknown> = () => {
onPress={() => onOpenCloseDrawer(FormMode.ADD)}
startContent={<FontAwesomeIcon icon={faAdd} />}
data-testid="pilot-add-button"
data-theme="lofi"
>
Add Entry
</Button>

View File

@@ -6,7 +6,6 @@ const LogbookCard = ({ logs, mode, onDelete, onOpenCloseForm }: LogbookCardProps
return (
<div>
{logs.map((log) => {
console.log(log)
const date = new Date(log.date);
const formattedDate: string = `${date.getMonth()}/${date.getDate()}/${date.getFullYear()}`;

View File

@@ -48,7 +48,6 @@ const LogbookDrawer = ({ onOpenClose }: LogbookDrawerProps) => {
};
const onSubmit = async (data: unknown) => {
console.log(data)
try {
logbookContext.dispatch({ type: 'SET_IS_FORM_LOADING', payload: true });

View File

@@ -50,7 +50,6 @@ const Pilots: React.FC<unknown> = () => {
};
const onOpenClosePilotForm = async (mode: FormMode, pilotId?: string) => {
console.log(pilotId)
switch (mode) {
case FormMode.ADD:
case FormMode.EDIT:

View File

@@ -101,16 +101,11 @@ const TracksForm = () => {
}, [logbookContext.state.selectedLogId])
useEffect(() => {
console.log(logbookContext.state.formMode)
if (logbookContext.state.formMode === FormMode.VIEW) {
dispatch({ type: 'SET_IS_DISABLED', payload: true });
}
}, [logbookContext.state.formMode]);
useEffect(() => {
console.log(state.isDisabled)
}, [state.isDisabled])
return (
<div className='grid grid-cols-12 gap-3'>
{state.tracks.length > 0 &&