Commit 6cbeedb6 authored by Jacob Schatz's avatar Jacob Schatz

Disabled into computed

parent f86cea6f
...@@ -16,6 +16,10 @@ const RepoCommitSection = { ...@@ -16,6 +16,10 @@ const RepoCommitSection = {
return this.changedFiles.map(f => Helper.getFilePathFromFullPath(f.url, branch)); return this.changedFiles.map(f => Helper.getFilePathFromFullPath(f.url, branch));
}, },
cantCommitYet() {
return !commitMessage || submitCommitsLoading;
},
filePluralize() { filePluralize() {
return this.changedFiles.length > 1 ? 'files' : 'file'; return this.changedFiles.length > 1 ? 'files' : 'file';
}, },
...@@ -84,7 +88,7 @@ export default RepoCommitSection; ...@@ -84,7 +88,7 @@ export default RepoCommitSection;
</div> </div>
</div> </div>
<div class="col-md-offset-4 col-md-4"> <div class="col-md-offset-4 col-md-4">
<button type="submit" :disabled="!commitMessage || submitCommitsLoading" class="btn btn-success submit-commit" @click.prevent="makeCommit"> <button type="submit" :disabled="cantCommitYet" class="btn btn-success submit-commit" @click.prevent="makeCommit">
<i class="fa fa-spinner fa-spin" v-if="submitCommitsLoading"></i> <i class="fa fa-spinner fa-spin" v-if="submitCommitsLoading"></i>
<span class="commit-summary">Commit {{changedFiles.length}} {{filePluralize}}</span> <span class="commit-summary">Commit {{changedFiles.length}} {{filePluralize}}</span>
</button> </button>
......
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