Problem
IOURequestStepConfirmation subscribes to the whole policy collection on every mount, but only uses it inside handleParticipantsAdded to find the destination workspace's rate and category defaults when the user switches recipient. That subscription and the map over every policy sit on the confirmation's first render for something the first render never touches, and the cost grows with the number of workspaces.
Goal
Remove the policy-collection subscription from the confirmation page so the first render after receipt capture does less work. The participant picker (ParticipantSearchResults) already subscribes to policies and only mounts while the picker is open, so it can resolve the selected workspace's policy and pass it to onParticipantsAdded instead.
PR
Parent
Issue Owner
Current Issue Owner: @cretadn22
Problem
IOURequestStepConfirmationsubscribes to the whole policy collection on every mount, but only uses it insidehandleParticipantsAddedto find the destination workspace's rate and category defaults when the user switches recipient. That subscription and the map over every policy sit on the confirmation's first render for something the first render never touches, and the cost grows with the number of workspaces.Goal
Remove the policy-collection subscription from the confirmation page so the first render after receipt capture does less work. The participant picker (
ParticipantSearchResults) already subscribes to policies and only mounts while the picker is open, so it can resolve the selected workspace's policy and pass it toonParticipantsAddedinstead.PR
Parent
Issue Owner
Current Issue Owner: @cretadn22