Compare commits

...

2 Commits

Author SHA1 Message Date
Ashwin Bhatkal
b92f15b7c6 fix: optional chain orderBy access in useLogsData to prevent crash 2026-03-24 20:00:20 +05:30
Ashwin Bhatkal
9d778ed79a fix: guard label.toLowerCase() against non-string values in NewSelect 2026-03-24 19:59:27 +05:30
2 changed files with 3 additions and 3 deletions

View File

@@ -127,7 +127,7 @@ export const filterOptionsBySearch = (
if ('options' in option && Array.isArray(option.options)) {
// Filter nested options
const filteredSubOptions = option.options.filter((subOption) =>
subOption.label.toLowerCase().includes(lowerSearchText),
String(subOption.label).toLowerCase().includes(lowerSearchText),
);
return filteredSubOptions.length > 0
@@ -136,7 +136,7 @@ export const filterOptionsBySearch = (
}
// Filter top-level options
return option.label.toLowerCase().includes(lowerSearchText)
return String(option.label).toLowerCase().includes(lowerSearchText)
? option
: undefined;
})

View File

@@ -71,7 +71,7 @@ export const useLogsData = ({
}, [logs.length, listQuery]);
const orderByTimestamp: OrderByPayload | null = useMemo(() => {
const timestampOrderBy = listQuery?.orderBy.find(
const timestampOrderBy = listQuery?.orderBy?.find(
(item) => item.columnName === 'timestamp',
);