Skip to content

Commit

Permalink
Make reload take no arguments (tensorflow#12)
Browse files Browse the repository at this point in the history
The greeter card's reload method used to take run and tag arguments, which caused a bug because the greeter dashboard would call the card's reload method with no arguments.

We now introduce a new _fetchNewData(run, tag) method to the greeter-card component which is used as an observer and used indirectly by the card's reload method.

Fixes tensorflow#11.
  • Loading branch information
chihuahua authored Oct 5, 2017
1 parent 15e3bab commit e4e142f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions greeter_plugin/greeter-card.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,20 +78,22 @@
},
},

observers: ["reload(run, tag)"],
observers: ["_fetchNewData(run, tag)"],

_computeRunColor(run) {
return this._colorScaleFunction(run);
},

attached() {
// Defer reloading until after we're attached, because that ensures that
// the requestManager has been set from above. (Polymer is tricky
// sometimes)
this._attached = true;
this.reload(this.run, this.tag);
this.reload();
},
reload() {
this._fetchNewData(this.run, this.tag);
},
reload(run, tag) {
_fetchNewData(run, tag) {
if (!this._attached) {
return;
}
Expand Down

0 comments on commit e4e142f

Please sign in to comment.