Revert "reset options if freq changes"

This reverts commit f64169385e.
master
Tom Hacohen 4 years ago
parent 2b8fa751b7
commit 9400abdbf4

@ -120,12 +120,7 @@ interface PropsType {
export default function RRule(props: PropsType) { export default function RRule(props: PropsType) {
const options = props.rrule; const options = props.rrule;
function updateRule(newOptions: Partial<RRuleOptions>): void { function updateRule(newOptions: Partial<RRuleOptions>): void {
let updatedOptions: RRuleOptions; const updatedOptions: RRuleOptions = { ...options, ...newOptions };
if (!!options.freq && !!newOptions.freq && options.freq !== newOptions.freq) {
updatedOptions = { freq: newOptions.freq };
} else {
updatedOptions = { ...options, ...newOptions } ;
}
for (const key of Object.keys(updatedOptions)) { for (const key of Object.keys(updatedOptions)) {
const value = updatedOptions[key]; const value = updatedOptions[key];

Loading…
Cancel
Save