mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-18 09:52:20 +00:00
Merge pull request #3818 from cstyles/null-history
Don't display chart if history is empty (#3691)
This commit is contained in:
commit
2d34c1cb9b
1 changed files with 3 additions and 3 deletions
|
|
@ -163,16 +163,16 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$
|
|||
var history = [], matrix, data, chart, options;
|
||||
switch (id) {
|
||||
case 'exp':
|
||||
$rootScope.charts.exp = !$rootScope.charts.exp;
|
||||
history = User.user.history.exp;
|
||||
$rootScope.charts.exp = (history.length == 0) ? false : !$rootScope.charts.exp;
|
||||
break;
|
||||
case 'todos':
|
||||
$rootScope.charts.todos = !$rootScope.charts.todos;
|
||||
history = User.user.history.todos;
|
||||
$rootScope.charts.todos = (history.length == 0) ? false : !$rootScope.charts.todos;
|
||||
break;
|
||||
default:
|
||||
$rootScope.charts[id] = !$rootScope.charts[id];
|
||||
history = task.history;
|
||||
$rootScope.charts[id] = (history.length == 0) ? false : !$rootScope.charts[id];
|
||||
if (task && task._editing) task._editing = false;
|
||||
}
|
||||
matrix = [['Date', 'Score']];
|
||||
|
|
|
|||
Loading…
Reference in a new issue