File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -22,8 +22,9 @@ import { errorMiddleware } from "./utils/middlewares";
2222 contentSecurityPolicy : {
2323 directives : {
2424 scriptSrc : isProd
25- ? [ "'self'" , "'unsafe-inline'" ] // astro needs 'unsafe-inline', look into https://github.com/KindSpells/astro-shield
25+ ? [ "'self'" , "'unsafe-inline'" ] // astro needs 'unsafe-inline'
2626 : [ "'self'" , "'unsafe-eval'" , "'unsafe-inline'" ] ,
27+ connectSrc : [ "'self'" , "https://api.coingecko.com" ] ,
2728 } ,
2829 } ,
2930 } ) ,
Original file line number Diff line number Diff line change @@ -29,17 +29,17 @@ export const Claim = () => {
2929 getClaimsByIds ( [ id ] ) . then ( ( claims ) => {
3030 setClaim ( claims [ 0 ] ) ;
3131 } ) ;
32-
33- getBitcoinExchangeRate ( ) . then ( ( rate ) => {
34- setUsdExchangeRate ( rate ) ;
35- } ) ;
3632 } , [ id ] ) ;
3733
3834 useEffect ( ( ) => {
3935 if ( ! claim || claim . status !== ClaimStatus . PAID ) {
4036 return ;
4137 }
4238
39+ getBitcoinExchangeRate ( ) . then ( ( rate ) => {
40+ setUsdExchangeRate ( rate ) ;
41+ } ) ;
42+
4343 const eventSource = subscribeSSE < { paymentId : string } > (
4444 `${ import . meta. env . PUBLIC_API_URL || "" } /api/payments/${ claim . id } ` ,
4545 ( { paymentId } ) => {
You can’t perform that action at this time.
0 commit comments