@@ -147,20 +147,27 @@ const saveStore = async (
147147 objToArray ( row , async ( cell , cellId ) => {
148148 const ids : [ Id , Id , Id ] = [ tableId , rowId , cellId ] ;
149149 const key = constructStorageKey ( storagePrefix , T , ...ids ) ;
150- isUndefined ( cell )
151- ? ! initialSave &&
150+ if ( isUndefined ( cell ) ) {
151+ if (
152+ ! initialSave &&
152153 ( await that . canDelCell (
153154 ...ids ,
154155 requestOrConnection as Connection ,
155- ) ) &&
156- arrayPush ( keysToDel , key )
157- : ( await that . canSetCell (
158- ...ids ,
159- cell ,
160- initialSave ,
161- requestOrConnection ,
162- await storage . get ( key ) ,
163- ) ) && ( keysToSet [ key ] = cell ) ;
156+ ) )
157+ ) {
158+ arrayPush ( keysToDel , key ) ;
159+ }
160+ } else if (
161+ await that . canSetCell (
162+ ...ids ,
163+ cell ,
164+ initialSave ,
165+ requestOrConnection ,
166+ await storage . get ( key ) ,
167+ )
168+ ) {
169+ keysToSet [ key ] = cell ;
170+ }
164171 } ) ,
165172 ) ) ,
166173 ) ,
@@ -171,20 +178,24 @@ const saveStore = async (
171178 await promiseAll (
172179 objToArray ( changes [ 1 ] , async ( value , valueId ) => {
173180 const key = storagePrefix + V + valueId ;
174- isUndefined ( value )
175- ? ! initialSave &&
176- ( await that . canDelValue (
177- valueId ,
178- requestOrConnection as Connection ,
179- ) ) &&
180- arrayPush ( keysToDel , key )
181- : ( await that . canSetValue (
182- valueId ,
183- value ,
184- initialSave ,
185- requestOrConnection ,
186- await storage . get ( key ) ,
187- ) ) && ( keysToSet [ key ] = value ) ;
181+ if ( isUndefined ( value ) ) {
182+ if (
183+ ! initialSave &&
184+ ( await that . canDelValue ( valueId , requestOrConnection as Connection ) )
185+ ) {
186+ arrayPush ( keysToDel , key ) ;
187+ }
188+ } else if (
189+ await that . canSetValue (
190+ valueId ,
191+ value ,
192+ initialSave ,
193+ requestOrConnection ,
194+ await storage . get ( key ) ,
195+ )
196+ ) {
197+ keysToSet [ key ] = value ;
198+ }
188199 } ) ,
189200 ) ;
190201
0 commit comments