Skip to content

Commit

Permalink
Merge branch 'hotfix/v0.4.1' into develop
Browse files Browse the repository at this point in the history
Fix a bug where dashboard did not render if there were no sessions.
  • Loading branch information
vnen committed Feb 24, 2015
2 parents 812710d + b6612a8 commit f53450c
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Writer's Trail change log


## v0.4.1

* Fix a bug where dashboard did not render if there were no sessions.

## v0.4.0

* Mandatory password for those who login with social network.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# [Writer's Trail](http://writerstrail.georgemarques.com.br)

v0.4.0
v0.4.1

[![Join the chat at https://gitter.im/flikore/writerstrail](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/flikore/writerstrail?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Writerstrail",
"version": "0.4.0",
"version": "0.4.1",
"authors": [
"George Marques <[email protected]>"
],
Expand Down
2 changes: 1 addition & 1 deletion npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "WritersTrail",
"version": "0.4.0",
"version": "0.4.1",
"private": true,
"scripts": {
"start": "node server.js"
Expand Down
5 changes: 3 additions & 2 deletions routes/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,16 @@ router.get('/dashboard', isactivated, sendflash, function (req, res, next) {
if (!todaySessions || todaySessions.length === 0) {
res.locals.errorMessage.push('You didn\'t write anything today. <a href="/timer" class="alert-link">Fix this and write now</a>.');
}
console.log('---daily', dailyAverage.length > 0 && dailyAverage[0].dailyAverage ? dailyAverage[0].dailyAverage : 0);
res.render('user/dashboard', {
title: 'Dashboard',
section: 'dashboard',
projects: projects,
target: target,
stats: {
totalWordcount: totalWordcount,
dailyAverage: dailyAverage.length > 0 ? dailyAverage[0].dailyAverage : 0,
wpm: wpm.length > 0 ? wpm[0].wpm : 0,
dailyAverage: dailyAverage.length > 0 && dailyAverage[0].dailyAverage ? dailyAverage[0].dailyAverage : 0,
wpm: wpm.length > 0 && wpm[0].wpm ? wpm[0].wpm : 0,
period: perfPeriod.length > 0 ? perfPeriod[0] : null,
session: perfSession.length > 0 ? perfSession[0] : null,
largestProject: largestProject
Expand Down

0 comments on commit f53450c

Please sign in to comment.