-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass currency and do not pass transaction_ids parameter to create instant deposit #7828
Changes from all commits
abe9398
a90c078
4ff88a6
2571606
08ec968
c8a6a92
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: minor | ||
Type: update | ||
|
||
Pass currency parameter and not transaction_ids parameter when creating instant deposit. | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -145,7 +145,6 @@ const createMockOverview = ( | |
fee: 0, | ||
net: 0, | ||
fee_percentage: 0, | ||
transaction_ids: [], | ||
}, | ||
}; | ||
}; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -136,7 +136,6 @@ const createMockOverview = ( | |
fee: 0, | ||
net: 0, | ||
fee_percentage: 0, | ||
transaction_ids: [], | ||
}, | ||
}; | ||
}; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -235,18 +235,18 @@ export const useDepositsSummary = ( { | |
}; | ||
|
||
export const useInstantDeposit = ( | ||
transactionIds: string[] | ||
currency: string | ||
): { inProgress: boolean; submit: () => void; deposit: unknown } => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thought (out of scope of this PR): we should use an interface from However, low priority, since this value from this hook is actually not currently used in our codebase (we only use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was wondering about that actually, whether it's necessary to return Do you think I should delete I tried to do that and there are a lot of things can be deleted. However, I thought they are necessary to keep the state of the button so we can use it to remove the button after an instant deposit is created but actually, even after preserving them ( |
||
const { deposit, inProgress } = useSelect( ( select ) => { | ||
const { getInstantDeposit, isResolving } = select( STORE_NAME ); | ||
|
||
return { | ||
deposit: getInstantDeposit( [ transactionIds ] ), | ||
inProgress: isResolving( 'getInstantDeposit', [ transactionIds ] ), | ||
deposit: getInstantDeposit( [ currency ] ), | ||
inProgress: isResolving( 'getInstantDeposit', [ currency ] ), | ||
}; | ||
} ); | ||
const { submitInstantDeposit } = useDispatch( STORE_NAME ); | ||
const submit = () => submitInstantDeposit( transactionIds ); | ||
const submit = () => submitInstantDeposit( currency ); | ||
|
||
return { deposit, inProgress, submit }; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,7 +54,6 @@ export interface InstantBalance { | |
fee: number; | ||
net: number; | ||
fee_percentage: number; | ||
transaction_ids: Array< string >; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
} | ||
|
||
export interface Overview { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add a changelog entry for this kind of change, one that is not user facing and a change that is only 'in the background'?
I assume yes but like a confirmation.