diff --git a/src/navigation/bottom-sheet/ReceiveNavigation.tsx b/src/navigation/bottom-sheet/ReceiveNavigation.tsx index aaea0391d..ee7a659f0 100644 --- a/src/navigation/bottom-sheet/ReceiveNavigation.tsx +++ b/src/navigation/bottom-sheet/ReceiveNavigation.tsx @@ -13,6 +13,7 @@ import Tags from '../../screens/Wallets/Receive/Tags'; import { useSnapPoints } from '../../hooks/bottomSheet'; import { NavigationContainer } from '../../styles/components'; import { viewControllerIsOpenSelector } from '../../store/reselect/ui'; +import { resetInvoice } from '../../store/actions/receive'; import { __E2E__ } from '../../constants/env'; export type ReceiveNavigationProp = @@ -37,11 +38,16 @@ const ReceiveNavigation = (): ReactElement => { viewControllerIsOpenSelector(state, 'receiveNavigation'), ); + const onOpen = (): void => { + resetInvoice(); + }; + return ( + testID="ReceiveScreen" + onOpen={onOpen}> diff --git a/src/screens/Wallets/Receive/ReceiveQR.tsx b/src/screens/Wallets/Receive/ReceiveQR.tsx index dc1694056..8a102c979 100644 --- a/src/screens/Wallets/Receive/ReceiveQR.tsx +++ b/src/screens/Wallets/Receive/ReceiveQR.tsx @@ -34,7 +34,6 @@ import { ShareIcon, } from '../../../styles/icons'; import { Caption13Up, Text02S } from '../../../styles/text'; -import { resetInvoice } from '../../../store/actions/receive'; import { updateMetaIncTxTags } from '../../../store/actions/metadata'; import { createLightningInvoice } from '../../../store/actions/lightning'; import { generateNewReceiveAddress } from '../../../store/actions/wallet'; @@ -186,7 +185,6 @@ const ReceiveQR = ({ } // Gives the modal animation time to start. sleep(50).then(() => { - resetInvoice(); // Only refresh LDK if we have a remote balance. if (lightningBalance.remoteBalance > 0) { refreshLdk({ selectedWallet, selectedNetwork }).then(); diff --git a/src/store/index.ts b/src/store/index.ts index 25d2bb617..8ab0be003 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -39,7 +39,7 @@ const persistConfig = { // increase version after store shape changes version: 15, stateReconciler: autoMergeLevel2, - blacklist: ['ui'], + blacklist: ['receive', 'ui'], migrate: createMigrate(migrations, { debug: __ENABLE_MIGRATION_DEBUG__ }), }; const persistedReducer = persistReducer(persistConfig, reducers); diff --git a/src/store/shapes/receive.ts b/src/store/shapes/receive.ts index 0db5bdfed..594688b9e 100644 --- a/src/store/shapes/receive.ts +++ b/src/store/shapes/receive.ts @@ -1,3 +1,5 @@ +// NOTE: 'receive' reducer is not persisted to storage + import { IReceive } from '../types/receive'; export const defaultReceiveShape: IReceive = {