diff --git a/packages/insomnia/src/ui/routes/runner.tsx b/packages/insomnia/src/ui/routes/runner.tsx index ccd3129246b..533d18ac1aa 100644 --- a/packages/insomnia/src/ui/routes/runner.tsx +++ b/packages/insomnia/src/ui/routes/runner.tsx @@ -306,9 +306,9 @@ export const Runner: FC<{}> = () => { window.main.trackSegmentEvent({ event: SegmentEvent.collectionRunExecute, properties: { plan: currentPlan?.type || 'scratchpad', iterations: iterationCount } }); - const selected = new Set(reqList.selectedKeys); - const requests = Array.from(reqList.items) - .filter(item => selected.has(item.id)); + const requests = reqList.selectedKeys === 'all' + ? reqList.items + : reqList.items.filter(item => (reqList.selectedKeys as Set).has(item.id)); // convert uploadData to environment data const userUploadEnvs = uploadData.map(data => { @@ -347,7 +347,7 @@ export const Runner: FC<{}> = () => { navigate(`/organization/${organizationId}/project/${projectId}/workspace/${workspaceId}/debug/request/${requestId}`); }; const onToggleSelection = () => { - if (Array.from(reqList.selectedKeys).length === Array.from(reqList.items).length) { + if (reqList.selectedKeys === 'all' || Array.from(reqList.selectedKeys).length === Array.from(reqList.items).length) { // unselect all reqList.setSelectedKeys(new Set([])); } else { @@ -478,10 +478,10 @@ export const Runner: FC<{}> = () => { ? Array.from(reqList.items) .filter(item => item.ancestorIds.includes(targetFolderId)) .map(item => item.id) - .filter(id => new Set(reqList.selectedKeys).has(id)) + .filter(id => reqList.selectedKeys === 'all' || new Set(reqList.selectedKeys).has(id)) : Array.from(reqList.items) .map(item => item.id) - .filter(id => new Set(reqList.selectedKeys).has(id)); + .filter(id => reqList.selectedKeys === 'all' || new Set(reqList.selectedKeys).has(id)); return ( <> @@ -600,7 +600,7 @@ export const Runner: FC<{}> = () => { { - Array.from(reqList.selectedKeys).length === Array.from(reqList.items).length ? + (reqList.selectedKeys === 'all' || Array.from(reqList.selectedKeys).length === Array.from(reqList.items).length) ? Unselect All : Array.from(reqList.selectedKeys).length === 0 ? Select All :