Skip to content

Commit b074cdb

Browse files
committed
last minute bug fixes
1 parent ebe333d commit b074cdb

File tree

2 files changed

+6
-23
lines changed

2 files changed

+6
-23
lines changed

src/components/SearchInput/SearchInput.jsx

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import React, { useState, useContext } from 'react';
1+
import React, { useState } from 'react';
22
import './SearchInput.scss';
3-
import { ReduxTestCaseContext } from '../../context/reducers/reduxTestCaseReducer';
43

54
const SearchInput = ({
65
dispatch,
@@ -17,8 +16,6 @@ const SearchInput = ({
1716
const [filteredOptions, setFilteredOptions] = useState([]);
1817
const [showOptions, setShowOptions] = useState(false);
1918
const [userInput, setUserInput] = useState('');
20-
const [, dispatchToReduxTestCase] = useContext(ReduxTestCaseContext);
21-
2219
const handleChange = (e) => {
2320
const input = e.currentTarget.value;
2421

@@ -41,12 +38,8 @@ const SearchInput = ({
4138
const selectedOption = e.target.type;
4239
const filePath = filePathMap[selectedOption] || '';
4340
if (updateTypesFilePath) {
44-
if (dispatchToReduxTestCase === dispatch) {
45-
dispatch(updateTypesFilePath(selectedOption, filePath, 'reducer'));
46-
dispatch(updateTypesFilePath(selectedOption, filePath, 'async'));
47-
dispatch(updateTypesFilePath(selectedOption, filePath, 'action-creator'));
48-
} else dispatch(updateTypesFilePath(selectedOption, filePath, type));
49-
} //type));
41+
dispatch(updateTypesFilePath(selectedOption, filePath, type));
42+
}
5043
if (updateActionsFilePath) dispatch(updateActionsFilePath(selectedOption, filePath, type));
5144
if (action) dispatch(action(selectedOption, filePath));
5245
};
@@ -60,12 +53,8 @@ const SearchInput = ({
6053
const filePath = filePathMap[selectedOption] || '';
6154
if (action) dispatch(action(selectedOption, filePath));
6255
if (updateTypesFilePath) {
63-
if (dispatchToReduxTestCase === dispatch) {
64-
dispatch(updateTypesFilePath(selectedOption, filePath, 'reducer'));
65-
dispatch(updateTypesFilePath(selectedOption, filePath, 'async'));
66-
dispatch(updateTypesFilePath(selectedOption, filePath, 'action-creator'));
67-
} else dispatch(updateTypesFilePath(selectedOption, filePath, type));
68-
} //type));
56+
dispatch(updateTypesFilePath(selectedOption, filePath, type));
57+
}
6958
} else if (e.keyCode === 38) {
7059
if (activeOption === 0) {
7160
return;

src/components/TestMenu/ReduxTestMenu.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
setFilePath,
66
toggleRightPanel,
77
setValidCode,
8-
toggleExportBool,
98
} from '../../context/actions/globalActions';
109
import {
1110
addAsync,
@@ -17,13 +16,8 @@ import {
1716
import Modal from '../Modals/Modal';
1817
import useGenerateTest from '../../context/useGenerateTest.jsx';
1918
import { GlobalContext } from '../../context/reducers/globalReducer';
20-
import {
21-
openBrowserDocs,
22-
setValidCode,
23-
toggleExportBool,
24-
} from '../../context/actions/globalActions';
2519
import { ReduxTestCaseContext } from '../../context/reducers/reduxTestCaseReducer';
26-
import { useToggleModal, validateInputs } from './testMenuHooks';
20+
import { useToggleModal } from './testMenuHooks';
2721

2822
const ReduxTestMenu = () => {
2923
const [{ reduxTestStatement, reduxStatements }, dispatchToReduxTestCase] = useContext(

0 commit comments

Comments
 (0)