fix: added conditional to fix undefined attribute exception

This commit is contained in:
ArthurMousatov 2023-08-23 23:37:09 -04:00
parent 97e08ebb15
commit 38148a9955

View File

@ -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);