mirror of
https://github.com/aljazceru/mutiny-web.git
synced 2026-01-01 13:24:28 +01:00
Apply federation to lightning balances if available
This commit is contained in:
committed by
Tony Giorgio
parent
e1cfae2f7f
commit
3bd1d03377
@@ -67,7 +67,9 @@ function InboundWarning() {
|
||||
const network = state.mutiny_wallet?.get_network() as Network;
|
||||
|
||||
const threshold = network === "bitcoin" ? 100000 : 10000;
|
||||
const balance = state.balance?.lightning || 0n;
|
||||
const balance =
|
||||
(state.balance?.lightning || 0n) +
|
||||
(state.balance?.federation || 0n);
|
||||
|
||||
if (balance === 0n && amount < threshold) {
|
||||
return i18n.t("settings.gift.receive_too_small", {
|
||||
|
||||
@@ -73,7 +73,9 @@ export function MethodChooser(props: {
|
||||
const [store, _actions] = useMegaStore();
|
||||
|
||||
const methods = createMemo(() => {
|
||||
const lnBalance = store.balance?.lightning || 0n;
|
||||
const lnBalance =
|
||||
(store.balance?.lightning || 0n) +
|
||||
(store.balance?.federation || 0n);
|
||||
const onchainBalance =
|
||||
(store.balance?.confirmed || 0n) +
|
||||
(store.balance?.unconfirmed || 0n);
|
||||
|
||||
@@ -116,7 +116,11 @@ function PlusCTA() {
|
||||
|
||||
const hasEnough = () => {
|
||||
if (!planDetails()) return false;
|
||||
return (state.balance?.lightning || 0n) > planDetails().amount_sat;
|
||||
return (
|
||||
(state.balance?.lightning || 0n) +
|
||||
(state.balance?.federation || 0n) >
|
||||
planDetails().amount_sat
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user