Преглед на файлове

Use 'deep-clone' method to avoid bug where array was copied by-reference and hence modified original array

sbkwgh преди 8 години
родител
ревизия
65f482496c
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      src/store/index.js

+ 1 - 1
src/store/index.js

@@ -45,7 +45,7 @@ export default new Vuex.Store({
 	},
 	getters: {
 		categoriesWithoutAll (state) {
-			var categories = state.meta.categories;
+			var categories = JSON.parse(JSON.stringify(state.meta.categories));
 			categories.shift();
 			categories.unshift({
 				name: 'Select a category',