Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const dispatchFormActions = (title, description) =>
Observable.concat(
// Fire 2 actions, one after the other
Observable.of(change('imageDialog', 'title', title)),
Observable.of(change('imageDialog', 'description', description)),
Observable.of({ type: actions.IMAGE_DIALOG_PREVIEW_SUCCESS }),
);
setArticleForm : article => {
dispatch(change(FORM_ARTICLE,"id",article.id));
dispatch(change(FORM_ARTICLE,"title",article.title));
dispatch(change(FORM_ARTICLE,"classify_id",article.classify_id));
dispatch(change(FORM_ARTICLE,"sub_title",article.sub_title));
dispatch(change(FORM_ARTICLE,"content",article.content));
},
insertArticle : (article,back) => {
let category;
for (const cate of categories) {
if (cate.extensions.includes(extname(modified.name).toLowerCase())) {
category = cate.name;
}
}
if (!category) {
category = 'Others';
}
modified.category = category;
modified.outputDir = resolve(store.getState().setting.downloadDir, category);
store.dispatch(change('addUrl', 'data', modified));
store.dispatch(change('addUrl', 'maxConnection', 16));
store.dispatch(change('addUrl', 'outputDir', modified.outputDir));
store.dispatch(change('addUrl', 'maxSpeed', null));
return modified;
}
await sleep(500);
count = count - 1;
}
return null;
};
changeCoverageStatusPlanned: () =>
(dispatch(change(FORM_NAMES.PlanningForm, ownProps.coverage + '.news_coverage_status',
{qcode: 'ncostat:int'}))),
});
onEntireBalance: (balance: TokenUnits, fee, isToken) => {
if (balance) {
let value;
if (isToken) {
value = balance.getDecimalized();
} else {
const wei = BigNumber.max(balance.value.sub(fee.value), new BigNumber(0));
value = new TokenUnits(wei, 18).getDecimalized();
}
dispatch(change('createTx', 'value', value));
}
},
onChangeGasLimit: (event, value) => {
return () => {
const minSize = getMinSize(mountPoint);
if (!minSize) {
return;
}
if (!volumeSize || volumeSize < minSize) {
dispatch(change(FORM_ID, sizeField, minSize));
}
};
};
}, () => {
if (_.has(this.props, 'formKey')) {
this.props.dispatch(changeWithKey(this.props.formName, this.props.formKey, this.props.field.name, _.uniq(values)));
} else {
this.props.dispatch(change(this.props.formName, this.props.field.name, _.uniq(values)));
}
});
}
export function setCaptcha(value = false) {
return change(FORM_NAME, 'recaptcha', value)
}
"changeMember" : (member, val) => {
dispatch(change(TEMPLATE_FORM_NAME, member, val));
}
}