File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -128,13 +128,13 @@ const proxyHandler: ProxyHandler<ProxyDraft> = {
128
128
( value === peek ( target . original , key ) ||
129
129
target . options . skipFinalization ! . has ( value ) )
130
130
) {
131
- const has = target . options . skipFinalization ! . has ( value ) ;
132
- if ( target . options . skipFinalization ! . has ( value ) ) {
131
+ const shouldSkip = target . options . skipFinalization ! . has ( value ) ;
132
+ if ( shouldSkip ) {
133
133
target . options . skipFinalization ! . delete ( value ) ;
134
134
}
135
135
ensureShallowCopy ( target ) ;
136
136
target . copy ! [ key ] = createDraft ( {
137
- original : has ? target . copy ! [ key ] : target . original [ key ] ,
137
+ original : shouldSkip ? target . copy ! [ key ] : target . original [ key ] ,
138
138
parentDraft : target ,
139
139
key : target . type === DraftType . Array ? Number ( key ) : key ,
140
140
finalities : target . finalities ,
@@ -153,9 +153,6 @@ const proxyHandler: ProxyHandler<ProxyDraft> = {
153
153
if ( arrayHandling && ! isDraft ( value ) && isDraftable ( value ) ) {
154
154
target . options . skipFinalization ! . add ( value ) ;
155
155
}
156
- if ( ! arrayHandling && target . options . skipFinalization ! . has ( value ) ) {
157
- target . options . skipFinalization ! . delete ( value ) ;
158
- }
159
156
return value ;
160
157
} ,
161
158
set ( target : ProxyDraft , key : string | number | symbol , value : any ) {
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ export function handleValue(
22
22
! isDraftable ( target , options ) ||
23
23
handledSet . has ( target ) ||
24
24
Object . isFrozen ( target ) ||
25
- options ? .skipFinalization ! . has ( target )
25
+ ( options ! . skipFinalization ! . has ( target ) )
26
26
)
27
27
return ;
28
28
const isSet = target instanceof Set ;
You can’t perform that action at this time.
0 commit comments