Skip to content

Commit b1e3e89

Browse files
committed
cleanup constructor
1 parent 7adea3e commit b1e3e89

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

public/js/report.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,25 @@ import AlignmentExporter from './alignment_exporter';
2020
class Report extends Component {
2121
constructor(props) {
2222
super(props);
23-
this.fetchResults();
23+
this.init();
2424
this.getDatabaseListString = this.getDatabaseListString.bind(this);
2525
this.toggleShowDatabases = this.toggleShowDatabases.bind(this);
2626
this.renderToggleDatabasesList = this.renderToggleDatabasesList.bind(this);
27-
this.maxDatabasesStringLength = 200;
27+
this.prepareAlignmentOfSelectedHits = this.prepareAlignmentOfSelectedHits.bind(this);
28+
this.prepareAlignmentOfAllHits = this.prepareAlignmentOfAllHits.bind(this);
29+
this.setStateFromJSON = this.setStateFromJSON.bind(this);
30+
}
2831

32+
init(){
33+
this.fetchResults();
2934
// Properties below are internal state used to render results in small
3035
// slices (see updateState).
3136
this.numUpdates = 0;
3237
this.nextQuery = 0;
3338
this.nextHit = 0;
3439
this.nextHSP = 0;
3540
this.maxHSPs = 3; // max HSPs to render in a cycle
41+
this.maxDatabasesStringLength = 200;
3642
this.state = {
3743
search_id: '',
3844
seqserv_version: '',
@@ -50,10 +56,8 @@ class Report extends Component {
5056
allQueriesLoaded: false,
5157
cloud_sharing_enabled: false,
5258
};
53-
this.prepareAlignmentOfSelectedHits = this.prepareAlignmentOfSelectedHits.bind(this);
54-
this.prepareAlignmentOfAllHits = this.prepareAlignmentOfAllHits.bind(this);
55-
this.setStateFromJSON = this.setStateFromJSON.bind(this);
5659
}
60+
5761
/**
5862
* Fetch results.
5963
*/

0 commit comments

Comments
 (0)