@@ -8,13 +8,11 @@ import { Collapsible, ConfirmModal, LoadingCircles } from '~/libs/ui'
88import { UserProfile } from '~/libs/core'
99import { downloadBlob } from '~/libs/shared'
1010
11- import { editPayment , exportSearchResults , getMemberHandle , getPaymentMethods , getPayments , getTaxForms } from '../../../lib/services/wallet'
11+ import { editPayment , exportSearchResults , getMemberHandle , getPayments } from '../../../lib/services/wallet'
1212import { Winning , WinningDetail } from '../../../lib/models/WinningDetail'
1313import { FilterBar , formatIOSDateString , PaymentView } from '../../../lib'
1414import { ConfirmFlowData } from '../../../lib/models/ConfirmFlowData'
1515import { PaginationInfo } from '../../../lib/models/PaginationInfo'
16- import { TaxForm } from '../../../lib/models/TaxForm'
17- import { PaymentProvider } from '../../../lib/models/PaymentProvider'
1816import PaymentEditForm from '../../../lib/components/payment-edit/PaymentEdit'
1917import PaymentsTable from '../../../lib/components/payments-table/PaymentTable'
2018
@@ -102,7 +100,7 @@ const ListView: FC<ListViewProps> = (props: ListViewProps) => {
102100 } , [ ] )
103101
104102 const convertToWinnings = useCallback (
105- ( payments : WinningDetail [ ] , handleMap : Map < number , string > , userHasTaxFormSetup : Map < string , boolean > , userHasPaymentProvider : Map < string , boolean > ) : ReadonlyArray < Winning > => payments . map ( payment => {
103+ ( payments : WinningDetail [ ] , handleMap : Map < number , string > ) : ReadonlyArray < Winning > => payments . map ( payment => {
106104 const now = new Date ( )
107105 const releaseDate = new Date ( payment . releaseDate )
108106 const diffMs = releaseDate . getTime ( ) - now . getTime ( )
@@ -129,9 +127,9 @@ const ListView: FC<ListViewProps> = (props: ListViewProps) => {
129127 }
130128
131129 if ( status === 'ON_HOLD' ) {
132- if ( ! userHasTaxFormSetup . get ( payment . winnerId ) ) {
130+ if ( ! payment . paymentStatus ?. taxFormSetupComplete ) {
133131 status = 'On Hold (Tax Form)'
134- } else if ( ! userHasPaymentProvider . get ( payment . winnerId ) ) {
132+ } else if ( ! payment . paymentStatus ?. payoutSetupComplete ) {
135133 status = 'On Hold (Payment Provider)'
136134 } else {
137135 status = 'On Hold (Member)'
@@ -169,30 +167,8 @@ const ListView: FC<ListViewProps> = (props: ListViewProps) => {
169167 const payments = await getPayments ( pagination . pageSize , ( pagination . currentPage - 1 ) * pagination . pageSize , filters )
170168 const winnerIds = payments . winnings . map ( winning => winning . winnerId )
171169
172- const onHoldUserIds = payments . winnings
173- . filter ( winning => winning . details [ 0 ] . status === 'ON_HOLD' )
174- . map ( winning => winning . winnerId )
175-
176- const userHasTaxFormSetup : Map < string , boolean > = new Map ( )
177- const userHasPaymentProvider : Map < string , boolean > = new Map ( )
178-
179- try {
180- const missingTaxForms = await getTaxForms ( 100 , 0 , onHoldUserIds )
181- const missingPaymentProviders = await getPaymentMethods ( 100 , 0 , onHoldUserIds )
182-
183- missingTaxForms . forms . forEach ( ( form : TaxForm ) => {
184- userHasTaxFormSetup . set ( form . userId , form . status === 'ACTIVE' )
185- } )
186-
187- missingPaymentProviders . paymentMethods . forEach ( ( method : PaymentProvider ) => {
188- userHasPaymentProvider . set ( method . userId , method . status === 'CONNECTED' )
189- } )
190- } catch ( err ) {
191- // Ignore errors
192- }
193-
194170 const handleMap = await getMemberHandle ( winnerIds )
195- const winningsData = convertToWinnings ( payments . winnings , handleMap , userHasTaxFormSetup , userHasPaymentProvider )
171+ const winningsData = convertToWinnings ( payments . winnings , handleMap )
196172 setWinnings ( winningsData )
197173 setPagination ( payments . pagination )
198174 } catch ( apiError ) {
0 commit comments