Skip to content

Commit 541a3e0

Browse files
Merge 636ddab into 2f050a4
2 parents 2f050a4 + 636ddab commit 541a3e0

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

src/hooks/sync-sites/use-sync-push.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,8 @@ export function useSyncPush( {
310310
const response = await getIpcApi().pushArchive(
311311
remoteSiteId,
312312
archivePath,
313-
options?.optionsToSync
313+
options?.optionsToSync,
314+
options?.specificSelectionPaths
314315
);
315316
const stateAfterUpload = getPushState( selectedSite.id, remoteSiteId );
316317

src/ipc-handlers.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,8 @@ export async function pushArchive(
802802
event: IpcMainInvokeEvent,
803803
remoteSiteId: number,
804804
archivePath: string,
805-
optionsToSync?: string[]
805+
optionsToSync?: string[],
806+
specificSelectionPaths?: string[]
806807
): Promise< { success: boolean; error?: string } > {
807808
const token = await getAuthenticationToken();
808809

@@ -822,6 +823,11 @@ export async function pushArchive(
822823
],
823824
];
824825

826+
if ( specificSelectionPaths && specificSelectionPaths.length > 0 ) {
827+
const joinedPaths = specificSelectionPaths.join( ',' );
828+
formData.push( [ 'list_sync_items', joinedPaths ] );
829+
}
830+
825831
if ( optionsToSync ) {
826832
formData.push( [ 'options', optionsToSync.join( ',' ) ] );
827833
}

src/preload.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,14 @@ const api: IpcApi = {
2424
archiveSite: ( id, format ) => ipcRendererInvoke( 'archiveSite', id, format ),
2525
exportSiteForPush: ( id, operationId, configuration ) =>
2626
ipcRendererInvoke( 'exportSiteForPush', id, operationId, configuration ),
27-
pushArchive: ( remoteSiteId, archivePath, optionsToSync ) =>
28-
ipcRendererInvoke( 'pushArchive', remoteSiteId, archivePath, optionsToSync ),
27+
pushArchive: ( remoteSiteId, archivePath, optionsToSync, specificSelectionPaths ) =>
28+
ipcRendererInvoke(
29+
'pushArchive',
30+
remoteSiteId,
31+
archivePath,
32+
optionsToSync,
33+
specificSelectionPaths
34+
),
2935
deleteSite: ( id, deleteFiles ) => ipcRendererInvoke( 'deleteSite', id, deleteFiles ),
3036
createSite: ( path, config ) => ipcRendererInvoke( 'createSite', path, config ),
3137
updateSite: ( updatedSite ) => ipcRendererInvoke( 'updateSite', updatedSite ),

0 commit comments

Comments
 (0)