Skip to content

Commit a3987c2

Browse files
committed
fix: ts errors
1 parent f185b11 commit a3987c2

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/renderer/components/blocks/forms/UnitIssuanceForm.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const UnitIssuanceForm = forwardRef<UnitIssuanceFormRef, UnitIssuanceFormProps>(
5656
const selectedIssuanceId = value;
5757
const foundIssuance = projectData?.issuances?.find((issuance) => issuance.id === selectedIssuanceId);
5858
if (!_.isNil(foundIssuance?.timeStaged)) {
59-
delete foundIssuance.timeStaged;
59+
delete foundIssuance?.timeStaged;
6060
}
6161
setSelectedIssuance(foundIssuance);
6262
};

src/renderer/components/blocks/widgets/SyncIndicator.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ const SyncIndicator: React.FC<SyncIndicatorProps> = ({ detailed, orgUid }) => {
5151
if (!newIsSynced) {
5252
newSyncRemaining =
5353
organizationList?.reduce((acc, org) => {
54+
// @ts-ignore
5455
return _.isNil(org.sync_remaining) ? acc : acc + org.sync_remaining;
5556
}, 0) ?? 0;
5657
}

src/renderer/hooks/useQueryParamState.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import _ from 'lodash';
22
import { useCallback, useEffect, useMemo, useState } from 'react';
3-
import { useLocation } from 'react-router-dom';
3+
import { useLocation } from 'react-router-dom'; // Define a TypeScript interface for the function's return type
44

55
// Define a TypeScript interface for the function's return type
66
interface QueryParamState<T> {
@@ -19,7 +19,7 @@ const useQueryParamState: QueryParamState<string> = (name, defaultValue = '') =>
1919
if (_.isNil(value) || value === '') {
2020
params.delete(name);
2121
} else {
22-
params.set(name, value);
22+
params.set(name, value ?? '');
2323
}
2424

2525
const newPath = params.toString() ? `${window.location.pathname}?${params}` : window.location.pathname;

0 commit comments

Comments
 (0)