Skip to content

Commit b5839a3

Browse files
Merge 9847bfc into fd7c1ef
2 parents fd7c1ef + 9847bfc commit b5839a3

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

‎src/modules/sync/hooks/use-selected-items-push-size.ts‎

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,25 @@ export function useSelectedItemsPushSize(
5252
);
5353

5454
const processNodeRecursively = ( node: TreeNode, pathPrefix: string[] ): void => {
55+
// Always skip the database folder - it's handled separately via the sqls node
56+
if ( node.name === 'database' ) {
57+
return;
58+
}
59+
5560
if ( node.checked ) {
56-
// If the node is fully checked, get its entire size
5761
if ( node.type === 'file' ) {
5862
sizePromises.push( getIpcApi().getFileSize( siteId, [ ...pathPrefix, node.name ] ) );
59-
} else {
60-
if ( node.name === 'mu-plugins' && node.children ) {
63+
} else if ( node.name === 'wp-content' || node.name === 'mu-plugins' ) {
64+
// For wp-content and mu-plugins, always process children to properly skip database
65+
if ( node.children ) {
6166
for ( const child of node.children ) {
6267
processNodeRecursively( child, [ ...pathPrefix, node.name ] );
6368
}
64-
} else {
65-
sizePromises.push(
66-
getIpcApi().getDirectorySize( siteId, [ ...pathPrefix, node.name ] )
67-
);
6869
}
70+
} else {
71+
sizePromises.push(
72+
getIpcApi().getDirectorySize( siteId, [ ...pathPrefix, node.name ] )
73+
);
6974
}
7075
} else if ( node.indeterminate && node.children ) {
7176
// If the node is indeterminate, process its children recursively

0 commit comments

Comments
 (0)