mirror of
https://github.com/AppFlowy-IO/AppFlowy-Web.git
synced 2025-11-30 03:18:02 +08:00
fix: undefined get
This commit is contained in:
@@ -1294,7 +1294,11 @@ export const useSelectFieldOptions = (fieldId: string, searchValue?: string) =>
|
||||
|
||||
if (!typeOption) return [] as SelectOption[];
|
||||
|
||||
return typeOption.options.filter((option) => {
|
||||
const normalizedOptions = typeOption.options.filter((option): option is SelectOption => {
|
||||
return Boolean(option && option.id && option.name);
|
||||
});
|
||||
|
||||
return normalizedOptions.filter((option) => {
|
||||
if (!searchValue) return true;
|
||||
return option.name.toLowerCase().includes(searchValue.toLowerCase());
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user