mirror of
https://github.com/RoboSats/robosats.git
synced 2025-01-31 02:21:35 +00:00
Fix rewards claim
This commit is contained in:
parent
61d6406e0a
commit
042fbdca2a
@ -92,11 +92,13 @@ const RobotInfo: React.FC<Props> = ({ coordinator, onClose }: Props) => {
|
||||
if (robot != null && slot?.token != null && robot.encPrivKey != null) {
|
||||
void signCleartextMessage(rewardInvoice, robot.encPrivKey, slot?.token).then(
|
||||
(signedInvoice) => {
|
||||
console.log('Signed message:', signedInvoice);
|
||||
void coordinator.fetchReward(signedInvoice, garage, slot?.token).then((data) => {
|
||||
console.log(data);
|
||||
setBadInvoice(data.bad_invoice ?? '');
|
||||
setShowRewardsSpinner(false);
|
||||
setWithdrawn(data.successful_withdrawal);
|
||||
setOpenClaimRewards(!(data.successful_withdrawal !== undefined));
|
||||
setOpenClaimRewards(!data.successful_withdrawal);
|
||||
});
|
||||
},
|
||||
);
|
||||
@ -307,6 +309,7 @@ const RobotInfo: React.FC<Props> = ({ coordinator, onClose }: Props) => {
|
||||
<Grid item alignItems='stretch' style={{ display: 'flex', maxWidth: 80 }}>
|
||||
<Button
|
||||
sx={{ maxHeight: 38 }}
|
||||
disabled={rewardInvoice === ''}
|
||||
onClick={(e) => {
|
||||
handleSubmitInvoiceClicked(e, rewardInvoice);
|
||||
}}
|
||||
|
@ -372,7 +372,7 @@ export class Coordinator {
|
||||
|
||||
const data = await apiClient.post(
|
||||
this.url,
|
||||
`${this.basePath}`,
|
||||
`${this.basePath}/api/reward/`,
|
||||
{
|
||||
invoice: signedInvoice,
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user