Commit 53ccf938 authored by Phil Hughes's avatar Phil Hughes

fixed commit action radio buttons getting into a weird state

parent c1b29823
...@@ -22,15 +22,23 @@ export default { ...@@ -22,15 +22,23 @@ export default {
return this.changedFiles.length > 0 && this.stagedFiles.length > 0; return this.changedFiles.length > 0 && this.stagedFiles.length > 0;
}, },
}, },
watch: {
disableMergeRequestRadio() {
this.updateSelectedCommitAction();
},
},
mounted() { mounted() {
if (this.currentBranch && !this.currentBranch.can_push) { this.updateSelectedCommitAction();
this.updateCommitAction(consts.COMMIT_TO_NEW_BRANCH);
} else if (this.disableMergeRequestRadio) {
this.updateCommitAction(consts.COMMIT_TO_CURRENT_BRANCH);
}
}, },
methods: { methods: {
...mapActions('commit', ['updateCommitAction']), ...mapActions('commit', ['updateCommitAction']),
updateSelectedCommitAction() {
if (this.currentBranch && !this.currentBranch.can_push) {
this.updateCommitAction(consts.COMMIT_TO_NEW_BRANCH);
} else if (this.disableMergeRequestRadio) {
this.updateCommitAction(consts.COMMIT_TO_CURRENT_BRANCH);
}
},
}, },
commitToCurrentBranch: consts.COMMIT_TO_CURRENT_BRANCH, commitToCurrentBranch: consts.COMMIT_TO_CURRENT_BRANCH,
commitToNewBranch: consts.COMMIT_TO_NEW_BRANCH, commitToNewBranch: consts.COMMIT_TO_NEW_BRANCH,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment