-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix contact list preserving after the wallet reset (#887)
* added contact book to the wallet * added contact sort and fixed the issue with updating contact * merged recent recipient with contacts * list height fix * added reset actions for vault settings, contacts and recent recipient --------- Co-authored-by: ost-ptk <[email protected]>
- Loading branch information
Showing
8 changed files
with
37 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 8 additions & 6 deletions
14
src/background/redux/recent-recipient-public-keys/reducer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
import { createReducer } from 'typesafe-actions'; | ||
|
||
import { RecentRecipientPublicKeysState } from './types'; | ||
import { recipientPublicKeyAdded } from './actions'; | ||
import { recipientPublicKeyAdded, recipientPublicKeyReseted } from './actions'; | ||
|
||
const initialState = [] as RecentRecipientPublicKeysState; | ||
|
||
export const reducer = createReducer(initialState).handleAction( | ||
recipientPublicKeyAdded, | ||
// This is a hack to make sure the most recent recipient is always at the top of the list. | ||
(state, action) => [...new Set([action.payload, ...state])] | ||
); | ||
export const reducer = createReducer(initialState) | ||
.handleAction(recipientPublicKeyReseted, () => initialState) | ||
.handleAction( | ||
recipientPublicKeyAdded, | ||
// This is a hack to make sure the most recent recipient is always at the top of the list. | ||
(state, action) => [...new Set([action.payload, ...state])] | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters