Skip to content

Commit

Permalink
fixes, use autoMergeLevel2
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTrunk committed Oct 3, 2023
1 parent 4c46838 commit 27f9bf9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/screens/Home/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,11 @@ function Home({ navigation }: Props) {
});

useEffect(() => {
if (newTx) {
if (newTx.rawTx) {
handleTxRequest(newTx.rawTx, newTx.chain, newTx.path);
clearTx?.();
}
}, [newTx]);
}, [newTx.rawTx]);

const checkXpubXpriv = async () => {
if (!xpubKey || !xprivKey) {
Expand Down
2 changes: 2 additions & 0 deletions src/store/flux/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const fluxSlice = createSlice({
state,
action: PayloadAction<{ wallet: string; data: string }>,
) => {
state.wallets = state.wallets || {};
state.wallets[action.payload.wallet] = state.wallets[
action.payload.wallet
] || { ...initialWalletState };
Expand All @@ -42,6 +43,7 @@ const fluxSlice = createSlice({
state,
action: PayloadAction<{ wallet: string; data: string }>,
) => {
state.wallets = state.wallets || {};
state.wallets[action.payload.wallet] = state.wallets[
action.payload.wallet
] || { ...initialWalletState };
Expand Down
7 changes: 6 additions & 1 deletion src/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
REGISTER,
Storage,
} from 'redux-persist';
import autoMergeLevel2 from 'redux-persist/lib/stateReconciler/autoMergeLevel2';
import { MMKV } from 'react-native-mmkv';

import theme from './theme';
Expand Down Expand Up @@ -42,9 +43,13 @@ export const reduxStorage: Storage = {
const persistConfig = {
key: 'root',
storage: reduxStorage,
stateReconciler: autoMergeLevel2,
};

const persistedReducer = persistReducer(persistConfig, reducers);
const persistedReducer = persistReducer<ReturnType<typeof reducers>>(
persistConfig,
reducers,
);

const store = configureStore({
reducer: persistedReducer,
Expand Down

0 comments on commit 27f9bf9

Please sign in to comment.