Skip to content

Commit

Permalink
fix: empty Redux when done
Browse files Browse the repository at this point in the history
  • Loading branch information
sdisalvo-crd committed May 3, 2024
1 parent 7a20eba commit 2a08a65
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/store/reducers/identifiersCache/identifiersCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,11 @@ import { FavouriteIdentifier, MultiSigGroup } from "./identifiersCache.types";
const initialState: {
identifiers: IdentifierShortDetails[];
favourites: FavouriteIdentifier[];
multiSigGroup: MultiSigGroup;
multiSigGroup: MultiSigGroup | undefined;
} = {
identifiers: [],
favourites: [],
multiSigGroup: {
groupId: "",
connections: [],
},
multiSigGroup: undefined,
};
const identifiersCacheSlice = createSlice({
name: "identifiersCache",
Expand Down Expand Up @@ -43,7 +40,10 @@ const identifiersCacheSlice = createSlice({
(fav) => fav.id !== action.payload
);
},
setMultiSigGroupCache: (state, action: PayloadAction<MultiSigGroup>) => {
setMultiSigGroupCache: (
state,
action: PayloadAction<MultiSigGroup | undefined>
) => {
state.multiSigGroup = action.payload;
},
},
Expand Down
1 change: 1 addition & 0 deletions src/ui/components/CreateIdentifier/CreateIdentifier.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ const CreateIdentifier = ({
setModalIsOpen(false);
setState(initialState);
setResumeMultiSig && setResumeMultiSig(null);
dispatch(setMultiSigGroupCache(undefined));
};

const CurrentStage =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ const IdentifierStage1 = ({
useEffect(() => {
if (groupId) {
const updateConnections = async () => {
const connections = multiSigGroupCache.connections;
setScannedConnections(connections);
const connections = multiSigGroupCache?.connections;
connections && setScannedConnections(connections);
};
updateConnections();
}
Expand Down

0 comments on commit 2a08a65

Please sign in to comment.