Skip to content

Commit

Permalink
Merge pull request #19 from Time-Lords/master
Browse files Browse the repository at this point in the history
no data userSleep
  • Loading branch information
Pierre-Gilles committed Jun 19, 2015
2 parents 8f458a6 + abf2f04 commit 752bc7d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion assets/js/app/sleep/sleep.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@
return sleepService.getSleep()
.then(function(data){
vm.recommended = data.data.recommended;
if(data.data.userSleep.length == 0){
return;
}
vm.lastSleep = data.data.userSleep[data.data.userSleep.length-1].duration;
vm.userSleep = data.data.userSleep;
var line = new Morris.Line({
element: 'line-chart',
Expand Down

0 comments on commit 752bc7d

Please sign in to comment.