Skip to content

Commit 0c3722b

Browse files
fix(proxy-state-tree): correctly compare paths for cached proxies
1 parent d212959 commit 0c3722b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,10 @@ export class Proxifier {
146146
return this.tree.master.mutationTree || (this.tree as IMutationTree<any>)
147147
}
148148
private createArrayProxy(value, path) {
149-
if (value[this.CACHED_PROXY] && String(value[PATH]) === String(path)) {
149+
if (
150+
value[this.CACHED_PROXY] &&
151+
String(value[this.CACHED_PROXY][PATH]) === String(path)
152+
) {
150153
return value[this.CACHED_PROXY]
151154
}
152155

@@ -250,7 +253,10 @@ export class Proxifier {
250253
}
251254

252255
private createObjectProxy(object, path) {
253-
if (object[this.CACHED_PROXY] && String(object[PATH]) === String(path)) {
256+
if (
257+
object[this.CACHED_PROXY] &&
258+
String(object[this.CACHED_PROXY][PATH]) === String(path)
259+
) {
254260
return object[this.CACHED_PROXY]
255261
}
256262

0 commit comments

Comments
 (0)