Skip to content

Commit

Permalink
Fixed ts issues
Browse files Browse the repository at this point in the history
  • Loading branch information
zfurtak committed Sep 20, 2024
1 parent dd5bda1 commit c5a6703
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/pages/Debug/DebugDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function DebugDetails({data, onSave, onDelete, validate}: DebugDetailsProps) {
)
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
.map(([key, value]) => [key, DebugUtils.onyxDataToString(value)])
.sort((a, b) => a.at(0).localeCompare(b.at(0))),
.sort((a, b) => (a.at(0) ?? '').localeCompare(b.at(0) ?? '')),
[data],
);
const dateTimeFields = useMemo(() => Object.entries(data ?? {}).filter(([key]) => DETAILS_DATETIME_FIELDS.includes(key as DetailsDatetimeFieldsKeys)) as Array<[string, string]>, [data]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function WorkspaceCategoriesSettingsPage({policy, route}: WorkspaceCategoriesSet
shouldPlaceSubtitleBelowSwitch
/>
<View style={[styles.containerWithSpaceBetween]}>
{canUseWorkspaceRules && !!currentPolicy && sections.at(0).data.length > 0 && (
{canUseWorkspaceRules && !!currentPolicy && (sections.at(0)?.data?.length ?? 0) > 0 && (
<SelectionList
headerContent={
<View style={[styles.mh5, styles.mt2, styles.mb1]}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ function WorkspaceReportFieldsPage({
];
}, [filteredPolicyFieldList, policy, selectedReportFields, canSelectMultiple, translate]);

useAutoTurnSelectionModeOffWhenHasNoActiveOption(reportFieldsSections.at(0).data);
useAutoTurnSelectionModeOffWhenHasNoActiveOption(reportFieldsSections.at(0)?.data ?? ([] as ListItem[]));

const updateSelectedReportFields = (item: ReportFieldForList) => {
const fieldKey = ReportUtils.getReportFieldKey(item.fieldID);
Expand Down

0 comments on commit c5a6703

Please sign in to comment.