Skip to content

Commit

Permalink
Coil Web Monetization event simulation feature - PR #472
Browse files Browse the repository at this point in the history
From kendraio/player-statistics
  • Loading branch information
lukestanley authored May 29, 2024
2 parents 80f3b70 + 5b152f3 commit 633300c
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/app/blocks/web-money/web-money.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,21 @@ export class WebMoneyComponent extends BaseBlockComponent {
}

}
if (document['monetization']) {
document['monetization'].addEventListener('monetizationprogress', monetizationprogressHandler);

// Coil's web monetization API is down because they have stopped their service.
// We are using a mock event to simulate the web monetization progress event:
function dispatchMockMonetizationProgressEvent() {
monetizationprogressHandler({
detail: {
amount: '1',
assetCode: 'XRP',
assetScale: 2,
},
});
}

setInterval(dispatchMockMonetizationProgressEvent, 1000);

}

onData(data: any, _firstChange: boolean) {
Expand Down

0 comments on commit 633300c

Please sign in to comment.