Skip to content

Commit

Permalink
handle warning re. tableModal update, seen in testing
Browse files Browse the repository at this point in the history
blast-results.{js,hbs} : add setTableModal() to set tableModal in later(), to avoid warning :  attempted to update tableModal, but it had already been used previously in the same computation.
  • Loading branch information
Don-Isdale committed Jun 24, 2021
1 parent f64085d commit 78c5087
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions frontend/app/components/panel/upload/blast-results.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Component from '@ember/component';
import { observer, computed } from '@ember/object';
import { inject as service } from '@ember/service';
import { alias } from '@ember/object/computed';
import { later as run_later } from '@ember/runloop';

import uploadBase from '../../../utils/panel/upload-base';
import uploadTable from '../../../utils/panel/upload-table';
Expand Down Expand Up @@ -53,6 +54,9 @@ export default Component.extend({

/*--------------------------------------------------------------------------*/

setTableModal(isModal) {
run_later(() => this.set('tableModal', isModal));
},
tableModalTargetId : computed('tableModal', function () {
return this.get('tableModal') ? 'blast-results-table-modal' : 'blast-results-table-panel';
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
{{#if this.tableModal}}
{{#ember-modal-dialog title="Blast Results" header-icon='list'}}
<button
onclick={{action (mut this.tableModal) false}}
onclick={{action this.setTableModal false}}
style="float: right; position: relative; top: -12px;" class="close"
type="button">x
</button>
Expand All @@ -34,7 +34,7 @@
{{#elem/button-base
classSize='xs'
classColour='default'
click=(action (mut this.tableModal) true )
click=(action this.setTableModal true )
icon='new-window'}}

{{#ember-tooltip side="left" delay=500}}
Expand Down

0 comments on commit 78c5087

Please sign in to comment.