Skip to content

Commit 102bed6

Browse files
fix(proxy-state-tree): revert on proxy instead of target
1 parent f8413cf commit 102bed6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/node_modules/proxy-state-tree/src/Proxyfier.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ export class Proxifier {
189189
path: path,
190190
args: args,
191191
hasChangedValue: true,
192-
revert: getArrayMutationRevert(method, target, args),
192+
revert: getArrayMutationRevert(method, proxy, args),
193193
})
194194

195195
if (process.env.NODE_ENV === 'production') {
@@ -230,9 +230,9 @@ export class Proxifier {
230230
hasChangedValue: true,
231231
revert: () => {
232232
if (existingValue === undefined) {
233-
delete target[prop]
233+
delete proxy[prop]
234234
} else {
235-
target[prop] = existingValue
235+
proxy[prop] = existingValue
236236
}
237237
},
238238
})
@@ -333,9 +333,9 @@ export class Proxifier {
333333
hasChangedValue: value !== target[prop],
334334
revert: () => {
335335
if (existingValue === undefined) {
336-
delete target[prop]
336+
delete proxy[prop]
337337
} else {
338-
target[prop] = existingValue
338+
proxy[prop] = existingValue
339339
}
340340
},
341341
},
@@ -368,7 +368,7 @@ export class Proxifier {
368368
args: [],
369369
hasChangedValue: true,
370370
revert: () => {
371-
target[prop] = existingValue
371+
proxy[prop] = existingValue
372372
},
373373
},
374374
objectChangePath

0 commit comments

Comments
 (0)