Skip to content

Commit

Permalink
blast-results-view : delay drawing the table until a result is received
Browse files Browse the repository at this point in the history
blast-results-view.js : showTable() : don't createTable() if ! data?.length, instead search.promise .then( shownBsTab() ).
  • Loading branch information
Don-Isdale committed Jun 9, 2021
1 parent d1bf486 commit 298c77e
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions frontend/app/components/panel/upload/blast-results-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,21 @@ export default Component.extend({


showTable() {
let table;
// delay creation of table until data is received
let data = this.get('data');
if (! data || ! data.length) {
let p = this.get('search.promise');
dLog('showTable', p.state && p.state());
p.then(() => {
dLog('showTable then', this.get('data')?.length);
// alternative : dataForTableEffect() could do this if ! table.
this.shownBsTab(); });
} else
// Ensure table is created when tab is shown
let table = this.get('table');
if (! table || ! table.rootElement || ! table.rootElement.isConnected) {
if (! (table = this.get('table')) ||
! table.rootElement ||
! table.rootElement.isConnected) {
this.createTable();
} else {
dLog('showTable', table.renderSuspendedCounter);
Expand Down

0 comments on commit 298c77e

Please sign in to comment.