Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated connection type for react/redux #34

Merged
merged 2 commits into from
Nov 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/client/components/ReqResCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,13 @@ const ReqResCtrl = {
console.log('sup')
const reqResContainer = document.querySelector('#reqResContainer');

if (reqResContainer.hasChildNodes()) {
let children = reqResContainer.childNodes;

for (let i = 0; i < children.length; i++) {
console.log(children[i])
}
}
// for (let resReqObj of resReqArr) {
// fetchController(resReqArr[e.id].endPoint, resReqArr[e.id].method, resReqArr[e.id].serverType);
// }
Expand Down
10 changes: 4 additions & 6 deletions src/client/components/display/ToggleBtn.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class ToggleBtn extends Component {
}

handleToggleClick(e, abortCtrl, props) {
console.log(this.props.reqResState.content.id)
/* On Click if Toggle isn't open yet, OPEN IT*/
if (this.state.isToggled) {
ReqResCtrl.toggleOpenEndPoint(e, abortCtrl);
Expand All @@ -33,6 +32,8 @@ class ToggleBtn extends Component {
const targetReqResObj = reqResArr.find(obj => obj.id == reqResComponentID);

targetReqResObj.connection = 'closed';
store.default.dispatch(actions.reqResUpdate(targetReqResObj));

this.state.abortController.abort();
this.setState({
abortController : new AbortController(),
Expand All @@ -43,14 +44,11 @@ class ToggleBtn extends Component {
isToggled: !prevState.isToggled
}));
}



render(props) {
return (
<button id={this.props.reqResState.content.id} onClick={
(e) => {
this.handleToggleClick(e, this.state.abortController)
}
(e) => this.handleToggleClick(e, this.state.abortController)
}>
{this.state.isToggled ? 'OPEN CONNECTION' : 'CLOSE CONNECTION'}
</button>
Expand Down