Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion components/VGitGraph.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ export default {
return filtered
},
initRoots() {
var filtered = Object.keys(this.$store.getters.rootBranches)
//var filtered = Object.keys(this.$store.getters.rootBranches)
var filtered = _.keys(_.pickBy(this._$, (branch)=>{return branch.x.length===1}))
this.$store.commit('addVisible', filtered)
console.log('otp: ', this.$store.state.show)
},
Expand Down
10 changes: 6 additions & 4 deletions store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,11 +369,13 @@ export const mutations = {

export const getters = {
rootBranches: state => {
var filtered = _.pickBy(state.branches, function(branch) {
return branch.x.length===1;
var roots = _.pickBy(state.branches, function(value, key) {
return value.x.length===1;
});
return filtered
},
const children = _.flatten(_.map(roots, "children"))
roots = _.pickBy(roots, (v,k)=> !children.includes(k))
return roots
},
compareX(arr1, arr2) {
const ln = Math.max(arr1.length, arr2.length)
for(var i=0; i<ln; i++) {
Expand Down