Skip to content

Commit

Permalink
fixup! front: update typescript-eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
SharglutDev committed Dec 17, 2024
1 parent 0d93bf9 commit c15388f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
12 changes: 6 additions & 6 deletions front/src/applications/editor/components/EntitySumUp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ import type { InfraError } from 'common/api/osrdEditoastApi';
import { LoaderFill } from 'common/Loaders';
import { getSpeedSectionsNameString } from 'common/Map/Layers/SpeedLimits';
import { useInfraID } from 'common/osrdContext';
import { setFailure } from 'reducers/main';
import { type AppDispatch, useAppDispatch } from 'store';
import { castErrorToFailure } from 'utils/error';

import { InfraErrorIcon, InfraErrorTypeLabel } from './InfraErrors';

Expand Down Expand Up @@ -63,7 +61,7 @@ async function getAdditionalEntities(
try {
return { [trackId]: await getEntity(infra, trackId, 'TrackSection', dispatch) };
} catch (e) {
setFailure(castErrorToFailure(e));
console.error(e);
return {};
}
}
Expand All @@ -82,7 +80,7 @@ async function getAdditionalEntities(
);
return results;
} catch (e) {
setFailure(castErrorToFailure(e));
console.error(e);
return {};
}
}
Expand All @@ -97,7 +95,8 @@ async function getAdditionalEntities(
dispatch
);
} catch (e) {
setFailure(castErrorToFailure(e));
// ignore error
console.error(e);
}
try {
results.exitPoint = await getEntity(
Expand All @@ -107,7 +106,8 @@ async function getAdditionalEntities(
dispatch
);
} catch (e) {
setFailure(castErrorToFailure(e));
// ignore error
console.error(e);
}
return results;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ import {
import { LinearMetadataDataviz } from 'common/IntervalsDataViz/dataviz';
import type { LinearMetadataItem } from 'common/IntervalsDataViz/types';
import { tooltipPosition, notEmpty } from 'common/IntervalsDataViz/utils';
import { setFailure } from 'reducers/main';
import { castErrorToFailure } from 'utils/error';

import { FormBeginEndWidget } from './FormBeginEndWidget';
import HelpModal from './HelpModal';
Expand Down Expand Up @@ -211,7 +209,8 @@ const IntervalEditorComponent = (
}
}
} catch (e) {
setFailure(castErrorToFailure(e));
// TODO: should we display it ?
console.error(e);
}
}}
/>
Expand Down Expand Up @@ -400,7 +399,8 @@ const IntervalEditorComponent = (
}
customOnChange(newData);
} catch (error) {
setFailure(castErrorToFailure(error));
// TODO: Should we display the resize error ?
console.error(error);
} finally {
setSelectedData(newItem);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ import type { ExtendedEditorContextType } from 'applications/editor/types';
import { osrdEditoastApi } from 'common/api/osrdEditoastApi';
import { useInfraID } from 'common/osrdContext';
import { save } from 'reducers/editor/thunkActions';
import { setFailure } from 'reducers/main';
import { useAppDispatch } from 'store';
import { castErrorToFailure } from 'utils/error';

import { Endpoints } from './EndPoints';
import { RouteMetadata } from './RouteMetadata';
Expand Down Expand Up @@ -189,7 +187,7 @@ const RouteEditionPanel = () => {
},
});
} catch (e) {
setFailure(castErrorToFailure(e));
console.error(e);
setState({ optionsState: { type: 'idle' } });
}
}, [infraID, setState, state.entity]);
Expand Down

0 comments on commit c15388f

Please sign in to comment.