summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/ide
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-10-15 10:02:40 +0100
committerPhil Hughes <me@iamphill.com>2018-10-15 10:02:40 +0100
commitff55aa7ebb8a54e5dceee845904a8c75b46b3f1b (patch)
tree08043dbad20b1742f79089825fdbdc23a3120d11 /app/assets/javascripts/ide
parent05dd7f9718cdd74cfd20747e4bea534a1cba2ae1 (diff)
downloadgitlab-ce-ff55aa7ebb8a54e5dceee845904a8c75b46b3f1b.tar.gz
Fixed file templates not clearing in Web IDE
This fixes a bug where the file templates would not be cleared after changing the template type. Previously the templates would get pushed into the array creating a list of templates for the different types. This changes that by clearing the templates array when the template type gets changed. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/52487
Diffstat (limited to 'app/assets/javascripts/ide')
-rw-r--r--app/assets/javascripts/ide/stores/modules/file_templates/mutations.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/assets/javascripts/ide/stores/modules/file_templates/mutations.js b/app/assets/javascripts/ide/stores/modules/file_templates/mutations.js
index d519c033769..25a65b047f1 100644
--- a/app/assets/javascripts/ide/stores/modules/file_templates/mutations.js
+++ b/app/assets/javascripts/ide/stores/modules/file_templates/mutations.js
@@ -13,6 +13,7 @@ export default {
},
[types.SET_SELECTED_TEMPLATE_TYPE](state, type) {
state.selectedTemplateType = type;
+ state.templates = [];
},
[types.SET_UPDATE_SUCCESS](state, success) {
state.updateSuccess = success;