mirror of
https://github.com/inventree/InvenTree.git
synced 2025-12-14 08:19:54 +00:00
refactor (frontend): address code scanning issues (#10935)
* remove unused defs * optimize * revert rename
This commit is contained in:
@@ -52,12 +52,12 @@ export function PrintingActions({
|
||||
const [labelId, setLabelId] = useState<number | undefined>(undefined);
|
||||
const [reportId, setReportId] = useState<number | undefined>(undefined);
|
||||
|
||||
const labelProgress = useDataOutput({
|
||||
useDataOutput({
|
||||
title: t`Printing Labels`,
|
||||
id: labelId
|
||||
});
|
||||
|
||||
const reportProgress = useDataOutput({
|
||||
useDataOutput({
|
||||
title: t`Printing Reports`,
|
||||
id: reportId
|
||||
});
|
||||
|
||||
@@ -30,7 +30,7 @@ export default function useDataExport({
|
||||
|
||||
const [exportId, setExportId] = useState<number | undefined>(undefined);
|
||||
|
||||
const progress = useDataOutput({
|
||||
useDataOutput({
|
||||
title: t`Exporting Data`,
|
||||
id: exportId
|
||||
});
|
||||
|
||||
@@ -40,7 +40,7 @@ export default function useDataOutput({
|
||||
} else setLoading(false);
|
||||
}, [id, title]);
|
||||
|
||||
const progress = useQuery({
|
||||
useQuery({
|
||||
enabled: !!id && loading && visibility === 'visible',
|
||||
refetchInterval: 500,
|
||||
queryKey: ['data-output', id, title],
|
||||
|
||||
@@ -49,7 +49,7 @@ export function useImportSession({
|
||||
setInstance(data);
|
||||
}, []);
|
||||
|
||||
const importSessionStatus = useStatusCodes({
|
||||
useStatusCodes({
|
||||
modelType: ModelType.importsession
|
||||
});
|
||||
|
||||
|
||||
@@ -72,11 +72,7 @@ export default function SalesOrderShipmentDetail() {
|
||||
}
|
||||
});
|
||||
|
||||
const {
|
||||
instance: customer,
|
||||
instanceQuery: customerQuery,
|
||||
refreshInstance: refreshCustomer
|
||||
} = useInstance({
|
||||
const { instance: customer, instanceQuery: customerQuery } = useInstance({
|
||||
endpoint: ApiEndpoints.company_list,
|
||||
pk: shipment.order_detail?.customer,
|
||||
hasPrimaryKey: true
|
||||
|
||||
@@ -103,9 +103,7 @@ export function MachineDriverTable({
|
||||
function MachineTypeDrawer({
|
||||
machineTypeSlug
|
||||
}: Readonly<{ machineTypeSlug: string }>) {
|
||||
const navigate = useNavigate();
|
||||
|
||||
const { machineTypes, refresh, isFetching } = useMachineTypeDriver({
|
||||
const { machineTypes, isFetching } = useMachineTypeDriver({
|
||||
includeDrivers: false
|
||||
});
|
||||
const machineType = useMemo(
|
||||
|
||||
Reference in New Issue
Block a user