Skip to content

Commit

Permalink
v0.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ikim23 committed Aug 5, 2021
1 parent 8b57175 commit 4415be6
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Unreleased]

## [0.1.2] - 2021-08-05

### Fixed

- Reset commit count on location change

## [0.1.1] - 2021-08-03

### Fixed
Expand All @@ -18,5 +24,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

- Add `gc` shortcut to Github Pull Request comment forms for interactive linking of commit hashes

[0.1.2]: https://github.com/ikim23/github-pr-commits/releases/tag/v0.1.1...v0.1.2
[0.1.1]: https://github.com/ikim23/github-pr-commits/releases/tag/v0.1.0...v0.1.1
[0.1.0]: https://github.com/ikim23/github-pr-commits/releases/tag/v0.1.0
4 changes: 2 additions & 2 deletions package-lock.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": "github-pr-commits",
"version": "0.1.1",
"version": "0.1.2",
"description": "Suggest Pull Request commits white typing",
"keywords": [
"github",
Expand Down
7 changes: 5 additions & 2 deletions src/content/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@ const COMMENT_FORM_CLASS = 'comment-form-textarea'
* - new commit in timeline
*/
function addPullRequestPageListener(listener) {
const getCommitCount = () => document.querySelectorAll('.js-commit').length

let prevHref = null
let commitCount = 0
let commitCount = getCommitCount()

const observer = new MutationObserver(() => {
if (prevHref != document.location.href) {
prevHref = document.location.href
commitCount = getCommitCount()
listener()
} else {
const currentCommitCount = document.querySelectorAll('.js-commit').length
const currentCommitCount = getCommitCount()
if (commitCount < currentCommitCount) {
commitCount = currentCommitCount
listener()
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "Github Pull Request Commits",
"version": "0.1.1",
"version": "0.1.2",
"description": "Suggest Pull Request commits white typing",
"permissions": ["https://api.github.com/*", "storage"],
"icons": {
Expand Down

0 comments on commit 4415be6

Please sign in to comment.