Skip to content

Commit

Permalink
ZEUS-2443: LNURL-Pay: retain currency unit state
Browse files Browse the repository at this point in the history
  • Loading branch information
kaloudis committed Oct 15, 2024
1 parent 47db6f3 commit 3fd2f36
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 3fd2f36

Please sign in to comment.