Skip to content

Commit

Permalink
Merge pull request #2468 from kaloudis/zeus-2443
Browse files Browse the repository at this point in the history
ZEUS-2443: LNURL-Pay: retain currency unit state
  • Loading branch information
kaloudis authored Oct 17, 2024
2 parents 075ef97 + 3fd2f36 commit 3364f32
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions views/LnurlPay/LnurlPay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { Row } from '../..//components/layout/Row';

import InvoicesStore from '../../stores/InvoicesStore';
import LnurlPayStore from '../../stores/LnurlPayStore';
import UnitsStore from '../../stores/UnitsStore';

import LnurlPayMetadata from './Metadata';

Expand All @@ -29,7 +28,6 @@ interface LnurlPayProps {
navigation: StackNavigationProp<any, any>;
InvoicesStore: InvoicesStore;
LnurlPayStore: LnurlPayStore;
UnitsStore: UnitsStore;
route: Route<'LnurlPay', { lnurlParams: any; amount: any }>;
}

Expand All @@ -40,7 +38,7 @@ interface LnurlPayState {
comment: string;
}

@inject('InvoicesStore', 'LnurlPayStore', 'UnitsStore')
@inject('InvoicesStore', 'LnurlPayStore')
@observer
export default class LnurlPay extends React.Component<
LnurlPayProps,
Expand Down Expand Up @@ -69,11 +67,9 @@ export default class LnurlPay extends React.Component<
}

stateFromProps(props: LnurlPayProps) {
const { UnitsStore, route } = props;
const { route } = props;
const { lnurlParams: lnurl, amount } = route.params ?? {};

UnitsStore.resetUnits();

return {
amount:
amount && amount != 0
Expand Down

0 comments on commit 3364f32

Please sign in to comment.