diff --git a/src/widgets/RRule.tsx b/src/widgets/RRule.tsx index 24859ee..e7b8ddd 100644 --- a/src/widgets/RRule.tsx +++ b/src/widgets/RRule.tsx @@ -85,7 +85,7 @@ const menuItemsWeekDays = weekdays.map((day) => { function makeArray(item: T) { if (item === undefined) { - return item; + return []; } else if (Array.isArray(item)) { return item; } else { @@ -95,16 +95,12 @@ function makeArray(item: T) { function sanitizeByDay(item: string | string[] | undefined) { const ret = makeArray(item); - if (Array.isArray(ret)) { - return (ret as string[]).map((value) => { - if (parseInt(value) === 1) { - return value.substr(1); - } - return value; - }); - } else { - return []; - } + return (ret as string[]).map((value) => { + if (parseInt(value) === 1) { + return value.substr(1); + } + return value; + }); } const styles = { @@ -250,7 +246,7 @@ export default function RRule(props: PropsType) { Months