Skip to content

Commit

Permalink
Merge pull request #29 from marslandd/tabletbatteryfix
Browse files Browse the repository at this point in the history
Correct hard battery error on tablet computers
  • Loading branch information
rossphilipson committed Jan 13, 2016
2 parents 8a87473 + 58d1a06 commit f9545c0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion dist/script/index_cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,10 @@ XenClient.UI.Cache = (function() {
device.refresh();
}
}
XUtils.publish(XenConstants.TopicTypes.UI_BATTERIES_CHANGED);
if(bat_count>-1)
{// do not refresh the batteries if there are none, may be in the midst of a refresh
XUtils.publish(XenConstants.TopicTypes.UI_BATTERIES_CHANGED);
}
};

var allVMPaths = function() {
Expand Down
5 changes: 4 additions & 1 deletion dist/script/models/batteryModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,10 @@ XenClient.UI.BatteryModel = function(bat_num) {
this.bat_index = XUICache.Host.available_batteries.indexOf(this.bat_num);

var error = function(error) {
XUICache.messageBox.showError(error, XenConstants.ToolstackCodes);
if(this.bat_num!=undefined)
{// suppress errors if the batteries are in the midst of being refreshed
XUICache.messageBox.showError(error, XenConstants.ToolstackCodes);
}
};
var self=this;

Expand Down

0 comments on commit f9545c0

Please sign in to comment.