gitgraph.js icon indicating copy to clipboard operation
gitgraph.js copied to clipboard

Data of Branches in Commit property does't update immediately?

Open Bear1110 opened this issue 6 years ago • 0 comments

https://codepen.io/nicoespeon/pen/arqPWb?editors=0010

You can easily reproduce this bug. Just add two line.

console.log(gitgraph._graph.commits[0].branches)
setTimeout(()=>{console.log(gitgraph._graph.commits[0].branches)},0)

In this example https://codepen.io/nicoespeon/pen/arqPWb?editors=0010.

image

Why I found this because I have to change commit color of stroke.

graphData.commits.forEach(commit=>{
        commit.style.dot.strokeColor = graphData.branches.get(commit.branches[0]).computedColor
    })
    commit.style.dot.strokeWidth = 3
    commit.style.dot.strokeColor = '#e60000'

I want to reset the stroke of color to same like color of branch. Then I found this bug? or my scenario is wrong .

Is there any one know this ? I am use @gitgraph/js. Thanks

Bear1110 avatar Oct 23 '19 09:10 Bear1110