Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Schatz <jschatz1@gmail.com>2017-10-13 00:31:40 +0300
committerJacob Schatz <jschatz1@gmail.com>2017-10-13 00:31:40 +0300
commit18a7805f383566534c915a426392738090d2426f (patch)
tree8cd6e401c915368d51f21bdc76417c1de02d80aa
parent1fab12cd1e4b026b278ba3231c1cd98d3cf473fd (diff)
Remove knownledge of service from store.
-rw-r--r--app/assets/javascripts/repo/components/repo_commit_section.vue21
-rw-r--r--app/assets/javascripts/repo/stores/repo_store.js15
2 files changed, 17 insertions, 19 deletions
diff --git a/app/assets/javascripts/repo/components/repo_commit_section.vue b/app/assets/javascripts/repo/components/repo_commit_section.vue
index bd8d29989a7..5f84217d23a 100644
--- a/app/assets/javascripts/repo/components/repo_commit_section.vue
+++ b/app/assets/javascripts/repo/components/repo_commit_section.vue
@@ -73,16 +73,17 @@ export default {
if (skipBranchCheck) {
this.makeCommit(newBranch);
} else {
- Store.setBranchHash()
- .then(() => {
- if (Store.branchChanged) {
- Store.showBranchChangeDialog = true;
- this.$emit('showBranchChangeDialog:enabled');
- return;
- }
- this.makeCommit(newBranch);
- })
- .catch(this.commitError);
+ Service.branchSingle()
+ .then((data) => {
+ Store.setBranchHash(data)
+ if (Store.branchChanged) {
+ Store.showBranchChangeDialog = true;
+ this.$emit('showBranchChangeDialog:enabled');
+ return;
+ }
+ this.makeCommit(newBranch);
+ })
+ .catch(this.commitError);
}
},
diff --git a/app/assets/javascripts/repo/stores/repo_store.js b/app/assets/javascripts/repo/stores/repo_store.js
index 0ef8eb53c3b..aec18cc2f8a 100644
--- a/app/assets/javascripts/repo/stores/repo_store.js
+++ b/app/assets/javascripts/repo/stores/repo_store.js
@@ -55,15 +55,12 @@ const RepoStore = {
});
},
- setBranchHash() {
- return Service.branchSingle()
- .then((data) => {
- if (RepoStore.currentHash !== '' && data.commit.id !== RepoStore.currentHash) {
- RepoStore.branchChanged = true;
- }
- RepoStore.currentHash = data.commit.id;
- RepoStore.currentShortHash = data.commit.short_id;
- });
+ setBranchHash(data) {
+ if (RepoStore.currentHash !== '' && data.commit.id !== RepoStore.currentHash) {
+ RepoStore.branchChanged = true;
+ }
+ RepoStore.currentHash = data.commit.id;
+ RepoStore.currentShortHash = data.commit.short_id;
},
hasBranchChanged() {