resolving conflict errors

This commit is contained in:
ben 2022-11-26 01:11:54 +00:00 committed by dni ⚡
parent 11b743a905
commit fd7a5ca465
3 changed files with 8 additions and 16 deletions

View file

@ -27,6 +27,9 @@ async def create_charge(user: str, data: CreateCharge) -> Charges:
onchainaddress = onchain.address onchainaddress = onchain.address
else: else:
onchainaddress = None onchainaddress = None
data.extra = json.dumps(
{"mempool_endpoint": "https://mempool.space", "network": "Mainnet"}
)
if data.lnbitswallet: if data.lnbitswallet:
payment_hash, payment_request = await create_invoice( payment_hash, payment_request = await create_invoice(
wallet_id=data.lnbitswallet, wallet_id=data.lnbitswallet,

View file

@ -308,17 +308,6 @@
display: none; display: none;
} }
</style> </style>
{% endblock %} % block styles %}
<link
href="/satspay/css/{{ charge_data.custom_css }}"
rel="stylesheet"
type="text/css"
/>
<style>
header button.q-btn-dropdown {
display: none;
}
</style>
{% endblock %} {% block scripts %} {% endblock %} {% block scripts %}
<script src="https://mempool.space/mempool.js"></script> <script src="https://mempool.space/mempool.js"></script>
@ -478,7 +467,7 @@
if (this.charge.custom_css) { if (this.charge.custom_css) {
document.body.setAttribute('data-theme', '') document.body.setAttribute('data-theme', '')
} }
if (this.charge.lnbitswallet) this.payInvoice() if (this.charge.payment_request) this.payInvoice()
else this.payOnchain() else this.payOnchain()
await this.checkBalances() await this.checkBalances()

View file

@ -1,5 +1,5 @@
from http import HTTPStatus from http import HTTPStatus
import json
from fastapi import Response from fastapi import Response
from fastapi.param_functions import Depends from fastapi.param_functions import Depends
from fastapi.templating import Jinja2Templates from fastapi.templating import Jinja2Templates
@ -36,15 +36,15 @@ async def display(request: Request, charge_id: str):
raise HTTPException( raise HTTPException(
status_code=HTTPStatus.NOT_FOUND, detail="Charge link does not exist." status_code=HTTPStatus.NOT_FOUND, detail="Charge link does not exist."
) )
logger.debug(charge) extra = json.loads(charge.extra)
return satspay_renderer().TemplateResponse( return satspay_renderer().TemplateResponse(
"satspay/display.html", "satspay/display.html",
{ {
"request": request, "request": request,
"charge_data": public_charge(charge), "charge_data": public_charge(charge),
"mempool_endpoint": charge.extra.mempool_endpoint, "mempool_endpoint": extra["mempool_endpoint"],
"network": charge.extra.network, "network": extra["network"],
}, },
) )