Skip to content

Commit

Permalink
Merge branch 'release/3.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
electerious committed Jun 27, 2021
2 parents 4d8bf15 + c714da0 commit 9a6e51d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [3.1.1] - 2021-06-27

### Fixed

- "Float cannot represent non numeric value: NaN" when visiting a new installation of Ackee

## [3.1.0] - 2021-06-27

> ⚠️ Contains breaking changes in the GraphQL API
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ackee",
"private": true,
"version": "3.1.0",
"version": "3.1.1",
"authors": [
"Tobias Reich <tobias@electerious.com>"
],
Expand Down
4 changes: 4 additions & 0 deletions src/resolvers/facts.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ module.exports = {
const totalCountPrevious = entries.slice(8, 15).reduce((acc, entry) => acc + entry.count, 0)
const totalDifference = totalCountCurrent - totalCountPrevious

if (totalCountPrevious === 0) return

return Math.min(Math.max(Math.round(totalDifference / totalCountPrevious * 100), -100), 100)
}),
},
Expand All @@ -36,6 +38,8 @@ module.exports = {
const totalCountPrevious = entries.slice(8, 15).reduce((acc, entry) => acc + entry.count, 0)
const totalDifference = totalCountCurrent - totalCountPrevious

if (totalCountPrevious === 0) return

return Math.min(Math.max(Math.round(totalDifference / totalCountPrevious * 100), -100), 100)
}),
},
Expand Down

1 comment on commit 9a6e51d

@vercel
Copy link

@vercel vercel bot commented on 9a6e51d Jun 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.