mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-19 02:04:10 +00:00
Don't display chart if history is empty.
This commit is contained in:
parent
e10c04c9bc
commit
0b01ff2201
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