diff --git a/frontend/src/store/mutations.js b/frontend/src/store/mutations.js index 87493609..bc8cece7 100644 --- a/frontend/src/store/mutations.js +++ b/frontend/src/store/mutations.js @@ -78,9 +78,12 @@ const mutations = { } }, updateRequest: (state, value) => { - state.oldReq = state.req; const selectedItems = state.selected.map((i) => state.req.items[i]); + state.oldReq = state.req; state.req = value; + state.selected = []; + + if (!state.req?.items) return; state.selected = state.req.items .filter((item) => selectedItems.some((rItem) => rItem.url === item.url)) .map((item) => item.index);