Skip to content

Commit a0794c0

Browse files
authored
addItems mutation fix tempId
If `tempId` was assigned before calling `addItems`-mutation -> `tempId` is undefined -> `newTempsById[undefined] = item`
1 parent 92e1e85 commit a0794c0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/service-module/service-module.mutations.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ export default function makeServiceMutations() {
4040
}
4141

4242
if (isTemp) {
43-
if (!item[tempIdField]) {
44-
var tempId = assignTempId(state, item)
43+
let tempId = item[tempIdField];
44+
if (!tempId) {
45+
tempId = assignTempId(state, item)
4546
}
4647
item.__isTemp = true
4748
newTempsById[tempId] = item

0 commit comments

Comments
 (0)