Skip to content

Commit fc6fef3

Browse files
committed
wrap actions with dispatch
1 parent 1424e24 commit fc6fef3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

client/modules/IDE/components/FileNode.jsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import PropTypes from 'prop-types';
22
import classNames from 'classnames';
33
import React, { useState, useRef } from 'react';
4-
import { connect } from 'react-redux';
4+
import { connect, useDispatch } from 'react-redux';
55
import { useTranslation } from 'react-i18next';
66

77
import * as IDEActions from '../actions/ide';
@@ -87,6 +87,7 @@ const FileNode = ({
8787
const [isEditingName, setIsEditingName] = useState(false);
8888
const [isDeleting, setIsDeleting] = useState(false);
8989
const [updatedName, setUpdatedName] = useState(name);
90+
const dispatch = useDispatch();
9091

9192
const { t } = useTranslation();
9293
const fileNameInput = useRef(null);
@@ -122,17 +123,17 @@ const FileNode = ({
122123
};
123124

124125
const handleClickAddFile = () => {
125-
newFile(id);
126+
dispatch(newFile(id));
126127
setTimeout(() => hideFileOptions(), 0);
127128
};
128129

129130
const handleClickAddFolder = () => {
130-
newFolder(id);
131+
dispatch(newFolder(id));
131132
setTimeout(() => hideFileOptions(), 0);
132133
};
133134

134135
const handleClickUploadFile = () => {
135-
openUploadFileModal(id);
136+
dispatch(openUploadFileModal(id));
136137
setTimeout(hideFileOptions, 0);
137138
};
138139

0 commit comments

Comments
 (0)