Skip to content

Commit 90e2f72

Browse files
committed
Clean up
1 parent 5f66b9c commit 90e2f72

File tree

8 files changed

+29
-105
lines changed

8 files changed

+29
-105
lines changed

main.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ const tbClearAllButton = new TouchBarButton({
7777
label: 'Clear All',
7878
backgroundColor: '#708090',
7979
click: () => {
80-
// console.log('clearing all');
8180
mainWindow.webContents.send('clearAll');
8281
},
8382
});

src/client/components/containers/App.jsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ class App extends Component {
2222
ipcRenderer.on('minimizeAll', ReqResCtrl.minimizeAllReqRes);
2323
ipcRenderer.on('expandAll', ReqResCtrl.expandAllReqRes);
2424
ipcRenderer.on('clearAll', ReqResCtrl.clearAllReqRes);
25-
ipcRenderer.on('message', (e, text) => {
26-
// console.log('Message from updater: ', text)
27-
});
2825
historyController.getHistory();
2926
collectionsController.getCollections();
3027

@@ -33,7 +30,7 @@ class App extends Component {
3330
render() {
3431
return (
3532
<div id="app">
36-
<UpdatePopUpContainer/>
33+
<UpdatePopUpContainer />
3734
<SidebarContainer />
3835
<ContentsContainer />
3936
</div>

src/client/components/containers/NavBarContainer.jsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ class NavBarContainer extends Component {
3737
const inputName = document.querySelector('#collectionNameInput').value;
3838
if (!!inputName.trim()) {
3939
collectionsController.collectionNameExists({ name: inputName })
40-
.catch((err) => console.log("error in checking collection name: ", err))
41-
.then((found) => {
42-
if (found) { //if the name already exists
43-
document.querySelector('#collectionNameInput').setAttribute("style", "border-color: red;");
44-
document.querySelector('#collectionNameError').setAttribute("style", "display: block");
45-
}
46-
else this.saveCollection(inputName)
47-
})
40+
.catch((err) => console.error("error in checking collection name: ", err))
41+
.then((found) => {
42+
if (found) { //if the name already exists
43+
document.querySelector('#collectionNameInput').setAttribute("style", "border-color: red;");
44+
document.querySelector('#collectionNameError').setAttribute("style", "display: block");
45+
}
46+
else this.saveCollection(inputName)
47+
})
4848
}
4949
}
5050
saveCollection(inputName) {
@@ -56,12 +56,12 @@ class NavBarContainer extends Component {
5656
reqRes.timeReceived = null;
5757
reqRes.connection = 'uninitialized';
5858
if (reqRes.response.hasOwnProperty('headers')) reqRes.response = { headers: null, events: null }
59-
else reqRes.response = {messages: []}
59+
else reqRes.response = { messages: [] }
6060
});
6161
const collectionObj = {
6262
name: inputName,
6363
id: uuid(),
64-
created_at: new Date(),
64+
created_at: new Date(),
6565
reqResArray: clonedArray
6666
}
6767
collectionsController.addCollectionToIndexedDb(collectionObj); //add to IndexedDB
@@ -127,8 +127,8 @@ class NavBarContainer extends Component {
127127
}}
128128
>
129129
<h1 id="heading">What would you like to name your collection?</h1>
130-
<input type={'text'} id="collectionNameInput" onKeyDown={(e) => this.handleKeyPress(e)} autoFocus/>
131-
<p id="collectionNameError" style={{display:'none'}}>Collection name already exists!</p>
130+
<input type={'text'} id="collectionNameInput" onKeyDown={(e) => this.handleKeyPress(e)} autoFocus />
131+
<p id="collectionNameError" style={{ display: 'none' }}>Collection name already exists!</p>
132132
<div>
133133
<button onClick={this.saveName}>Save</button>
134134
<button onClick={this.handleCloseModal}>Cancel</button>

src/client/components/display/CookieTable.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ class CookieTable extends Component {
88
}
99

1010
render() {
11-
// console.log('all cookies', this.props.cookies)
1211
let cookieRowArray;
1312
if (Array.isArray(this.props.cookies)) {
1413
cookieRowArray = this.props.cookies.map((cookie, i) => {

src/client/components/display/RequestTabs.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ class RequestTabs extends Component {
3434
});
3535
break;
3636
default:
37-
// console.log(`There was an error with ${val}`);
3837
}
3938
}
4039

src/client/controllers/collectionsController.js

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,39 +7,35 @@ const collectionsController = {
77

88
addCollectionToIndexedDb(collection) {
99
db.collections.put({ ...collection })
10-
.catch((err) => console.log('Error in addToCollection', err))
10+
.catch(err => console.log('Error in addToCollection', err));
1111
},
1212

1313
deleteCollectionFromIndexedDb(id) {
1414
db.collections.delete(id)
15-
.catch((err) => console.log('Error in deleteFromCollection', err))
15+
.catch(err => console.log('Error in deleteFromCollection', err));
1616
},
1717

1818
getCollections() {
1919
db.table('collections')
2020
.toArray()
21-
.then(collections => {
21+
.then((collections) => {
2222
const collectionsArr = collections.sort((a, b) => b.created_at - a.created_at);
2323
store.default.dispatch(actions.getCollections(collectionsArr));
2424
})
2525
.catch(err => console.log('Error in getCollections', err));
2626
},
2727

2828
collectionNameExists(obj) {
29-
const { name } = obj
30-
console.log(name)
31-
return new Promise((resolve, reject) => { //resolve and reject are functions!
32-
db.collections.where("name").equalsIgnoreCase(name).first(foundCollection => {
33-
foundCollection ? console.log(`Found ${name}`) : console.log("nope not here")
34-
return !!foundCollection
35-
})
36-
.then((found) => { console.log("found: ", found); resolve(found)})
37-
.catch(error => {
38-
console.error(error.stack || error);
39-
reject(error)
40-
});
41-
})
42-
}
43-
}
29+
const { name } = obj;
30+
return new Promise((resolve, reject) => { // resolve and reject are functions!
31+
db.collections.where('name').equalsIgnoreCase(name).first(foundCollection => !!foundCollection)
32+
.then(found => resolve(found))
33+
.catch((error) => {
34+
console.error(error.stack || error);
35+
reject(error);
36+
});
37+
});
38+
},
39+
};
4440

4541
export default collectionsController;

src/client/controllers/httpController.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const httpController = {
1515
console.log('HTTPS, TRYING HTTP2');
1616
httpController.establishHTTP2Connection(reqResObj, connectionArray);
1717
} else {
18-
// console.log('HTTP REQUEST, MOVING TO FETCH');
18+
console.log('HTTP REQUEST, MOVING TO FETCH');
1919
httpController.establishHTTP1connection(reqResObj, connectionArray);
2020
}
2121
},
@@ -326,7 +326,7 @@ const httpController = {
326326
parseFetchOptionsFromReqRes(reqResObject) {
327327
let {
328328
method, headers, body, cookies
329-
} = reqResObject.request;
329+
} = reqResObject.request;
330330

331331
method = method.toUpperCase();
332332

src/client/controllers/testNodeHTTP2Client.js

Lines changed: 0 additions & 66 deletions
This file was deleted.

0 commit comments

Comments
 (0)