Skip to content

Commit

Permalink
Check if time exists, so it doesnt show 'Agora' on undefned or null t…
Browse files Browse the repository at this point in the history
…imes

Signed-off-by: Gabriela Barrozo Guedes <[email protected]>
  • Loading branch information
gabibguedes committed Mar 20, 2020
1 parent 4ccfe23 commit e823206
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/pages/Transducer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ export default {
},
getTime (d) {
let ans = timePassed(d)
if (ans !== 'agora') {
if (ans !== 'agora' && ans !== 'indeterminado') {
ans = '' + ans
}
return ans
Expand Down
4 changes: 3 additions & 1 deletion src/utils/timePassed.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ export default function timePassed (time) {
return h + 'h ' + m + 'min'
}
}
} else {
} else if (time !== undefined && time !== null) {
return 'agora'
} else {
return 'indeterminado'
}
}

0 comments on commit e823206

Please sign in to comment.