Skip to content

Commit

Permalink
Reset parameters when selecting a new game in configurer
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoJF committed Oct 10, 2020
1 parent 1faf29e commit 2c7518a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions resources/js/components/configurer/CreationConfigurer.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export default function CreationConfigurer() {
function handleGameSelect(game) {
dispatch.form.update({game});
dispatch.form.clear(['game', 'billing_period']);
dispatch.parameters.clear();
if (game) {
dispatch.locations.load(game);
} else {
Expand Down
4 changes: 4 additions & 0 deletions resources/js/components/configurer/stores/parameters.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ export const parameters = {
state.parameters = payload;
return state;
},
clear(state, payload) {
state.parameters = {};
return state;
}
},
effects: dispatch => ({
async fetchParameters({game, location, ...rest}, root) {
Expand Down

0 comments on commit 2c7518a

Please sign in to comment.