Commit 42430d06 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'ph/326904/fixSquashBeingReset' into 'master'

Fixes polling in ready to merge overwriting local state

See merge request gitlab-org/gitlab!58636
parents 2eb065b2 4d4d28ec
...@@ -54,11 +54,7 @@ export default { ...@@ -54,11 +54,7 @@ export default {
}, },
manual: true, manual: true,
result({ data }) { result({ data }) {
this.state = { if (Object.keys(this.state).length === 0) {
...data.project.mergeRequest,
mergeRequestsFfOnlyEnabled: data.project.mergeRequestsFfOnlyEnabled,
onlyAllowMergeIfPipelineSucceeds: data.project.onlyAllowMergeIfPipelineSucceeds,
};
this.removeSourceBranch = this.removeSourceBranch =
data.project.mergeRequest.shouldRemoveSourceBranch || data.project.mergeRequest.shouldRemoveSourceBranch ||
data.project.mergeRequest.forceRemoveSourceBranch || data.project.mergeRequest.forceRemoveSourceBranch ||
...@@ -67,9 +63,16 @@ export default { ...@@ -67,9 +63,16 @@ export default {
this.squashBeforeMerge = data.project.mergeRequest.squashOnMerge; this.squashBeforeMerge = data.project.mergeRequest.squashOnMerge;
this.isSquashReadOnly = data.project.squashReadOnly; this.isSquashReadOnly = data.project.squashReadOnly;
this.squashCommitMessage = data.project.mergeRequest.defaultSquashCommitMessage; this.squashCommitMessage = data.project.mergeRequest.defaultSquashCommitMessage;
}
this.state = {
...data.project.mergeRequest,
mergeRequestsFfOnlyEnabled: data.project.mergeRequestsFfOnlyEnabled,
onlyAllowMergeIfPipelineSucceeds: data.project.onlyAllowMergeIfPipelineSucceeds,
};
this.loading = false; this.loading = false;
if (this.state.mergeTrainsCount !== null) { if (this.state.mergeTrainsCount !== null && this.state.mergeTrainsCount !== undefined) {
this.initPolling(); this.initPolling();
} }
}, },
......
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