From ff55aa7ebb8a54e5dceee845904a8c75b46b3f1b Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Mon, 15 Oct 2018 10:02:40 +0100 Subject: 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 --- app/assets/javascripts/ide/stores/modules/file_templates/mutations.js | 1 + 1 file changed, 1 insertion(+) (limited to 'app/assets/javascripts/ide') 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; -- cgit v1.2.1