File tree Expand file tree Collapse file tree 1 file changed +18
-4
lines changed
frontend/src/config/store Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -309,16 +309,30 @@ export const useStore = create<Store>()(
309309
310310 // Get the set of column IDs being rerun
311311 const rerunColumnIds = new Set ( cells . map ( cell => cell . columnId ) ) ;
312+
313+ // Get the set of row IDs being rerun
314+ const rerunRowIds = new Set ( cells . map ( cell => cell . rowId ) ) ;
312315
313- // Only clear resolvedEntities for columns being rerun
316+ // Only clear resolvedEntities for the specific cells being rerun
314317 editTable ( activeTableId , {
315318 columns : columns . map ( col => ( {
316319 ...col ,
317- resolvedEntities : rerunColumnIds . has ( col . id ) ? [ ] : col . resolvedEntities
320+ resolvedEntities : rerunColumnIds . has ( col . id )
321+ ? ( col . resolvedEntities || [ ] ) . filter ( entity => {
322+ // Keep entities that aren't from the rows being rerun
323+ if ( entity . source . type === 'column' ) {
324+ const entityRowId = cells . find ( cell =>
325+ cell . columnId === entity . source . id
326+ ) ?. rowId ;
327+ return ! entityRowId || ! rerunRowIds . has ( entityRowId ) ;
328+ }
329+ return true ;
330+ } )
331+ : ( col . resolvedEntities || [ ] )
318332 } ) ) ,
319333 globalRules : globalRules . map ( rule => ( {
320- ...rule ,
321- resolvedEntities : rule . resolvedEntities || [ ]
334+ ...rule ,
335+ resolvedEntities : rule . resolvedEntities || [ ]
322336 } ) )
323337 } ) ;
324338
You can’t perform that action at this time.
0 commit comments