mirror of
https://github.com/PrimalHQ/primal-web-app.git
synced 2024-10-01 17:31:13 +00:00
Fix lnbc rendering when error is encountered
This commit is contained in:
parent
948a1d7cba
commit
4e22957391
@ -16,7 +16,7 @@ import { sendMessage, subTo } from '../../lib/sockets';
|
||||
import { APP_ID } from '../../App';
|
||||
import { signEvent } from '../../lib/nostrAPI';
|
||||
import Loader from '../Loader/Loader';
|
||||
import { logError, logInfo } from '../../lib/logger';
|
||||
import { logError, logInfo, logWarning } from '../../lib/logger';
|
||||
import { useToastContext } from '../Toaster/Toaster';
|
||||
import { useIntl } from '@cookbook/solid-intl';
|
||||
import { lnInvoice } from '../../translations';
|
||||
@ -35,9 +35,13 @@ const Lnbc: Component< { id?: string, lnbc: string } > = (props) => {
|
||||
const [paymentInProgress, setPaymentInProgress] = createSignal(false);
|
||||
|
||||
createEffect(() => {
|
||||
const dec: LnbcInvoice = decode(props.lnbc);
|
||||
setInvoice(reconcile({...emptyInvoice}))
|
||||
setInvoice(() => ({ ...dec }));
|
||||
try {
|
||||
const dec: LnbcInvoice = decode(props.lnbc);
|
||||
setInvoice(reconcile({...emptyInvoice}))
|
||||
setInvoice(() => ({ ...dec }));
|
||||
} catch (e) {
|
||||
logError('Failed to decode lightining unvoice: ', e);
|
||||
}
|
||||
});
|
||||
|
||||
createEffect(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user