this.setState({ files });
const ids = values(getProjectsTreePickerIds(this.props.commandInput.id));
- deletedFiles.forEach(({ id }) => {
- ids.forEach(pickerId => {
- this.props.dispatch(
- treePickerActions.DESELECT_TREE_PICKER_NODE({
- pickerId, id,
- })
- );
- });
+ ids.forEach(pickerId => {
+ this.props.dispatch(
+ treePickerActions.DESELECT_TREE_PICKER_NODE({
+ pickerId, id: deletedFiles.map(({ id }) => id),
+ })
+ );
});
}
: [...addedFiles, file]
, []);
- this.setState({ files });
-
const ids = values(getProjectsTreePickerIds(this.props.commandInput.id));
- addedFiles.forEach(({ id }) => {
- ids.forEach(pickerId => {
- this.props.dispatch(
- treePickerActions.SELECT_TREE_PICKER_NODE({
- pickerId, id,
- })
- );
- });
+ ids.forEach(pickerId => {
+ this.props.dispatch(
+ treePickerActions.SELECT_TREE_PICKER_NODE({
+ pickerId, id: addedFiles.map(({ id }) => id),
+ })
+ );
});
+ this.setFiles(files);
+
}
refreshFiles = () => {