Skip to content

Commit e266e9e

Browse files
committed
refactor code to fix failing build
1 parent 68dc311 commit e266e9e

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

public/js/report.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,7 @@ class Report extends Component {
171171
* and circos would have been rendered at this point. At this stage we kick
172172
* start iteratively adding 1 HSP to the page every 25 milli-seconds.
173173
*/
174-
componentDidUpdate(props, state) {
175-
if (this.getDatabaseListString() !== this.getDatabaseListString(state.querydb)) {
176-
this.setState({ databasesList: this.getDatabaseListString().substring(0, this.maxDatabasesStringLength) + '...' });
177-
}
174+
componentDidUpdate() {
178175
// Log to console how long the last update take?
179176
console.log((Date.now() - this.lastTimeStamp) / 1000);
180177

@@ -347,19 +344,22 @@ class Report extends Component {
347344
</div>
348345
);
349346
}
347+
350348
getDatabaseListString(querydb = this.state.querydb) {
351349
return querydb
352350
.map((db) => {
353351
return db.title;
354352
})
355353
.join(', ');
356354
}
355+
357356
toggleShowDatabases() {
358357
const databases = this.state.showMore ? `${this.getDatabaseListString().substring(0, this.maxDatabasesStringLength)}...` : `${this.getDatabaseListString()}`;
359358
this.setState({ databasesList: databases, showMore: !this.state.showMore });
360359
}
360+
361361
renderToggleDatabasesList() {
362-
return <span onClick={this.toggleShowDatabases}>{this.state.databasesList}<span style={{ cursor: 'pointer' }} className="btn-link hover-bold">&nbsp;&nbsp;{this.state.showMore ? 'Show Less' : 'Show More'}</span></span>;
362+
return <span onClick={this.toggleShowDatabases}>{this.state.databasesList || this.getDatabaseListString().substring(0, this.maxDatabasesStringLength) + '...'}<span style={{ cursor: 'pointer' }} className="btn-link hover-bold">&nbsp;&nbsp;{this.state.showMore ? 'Show Less' : 'Show More'}</span></span>;
363363
}
364364
/**
365365
* Renders report overview.

0 commit comments

Comments
 (0)