-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1624 from oasisprotocol/lw/to-support-deleting-acc
Small refactoring to later support deleting accounts
- Loading branch information
Showing
19 changed files
with
59 additions
and
60 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
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
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
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,8 +1,8 @@ | ||
import { createSelector } from '@reduxjs/toolkit' | ||
import { selectAccountAddress } from 'app/state/account/selectors' | ||
import { selectAddress, selectIsOpen } from 'app/state/wallet/selectors' | ||
import { selectAddress, selectHasAccounts } from 'app/state/wallet/selectors' | ||
|
||
export const selectIsAddressInWallet = createSelector( | ||
[selectIsOpen, selectAddress, selectAccountAddress], | ||
(walletIsOpen, walletAddress, address) => walletIsOpen && walletAddress === address, | ||
[selectHasAccounts, selectAddress, selectAccountAddress], | ||
(hasAccounts, walletAddress, address) => hasAccounts && walletAddress === address, | ||
) |
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,17 +1,20 @@ | ||
import { createSelector } from '@reduxjs/toolkit' | ||
import { selectSlice as selectPersistSlice } from 'app/state/persist/selectors' | ||
import { selectIsOpen } from 'app/state/wallet/selectors' | ||
import { selectHasAccounts } from 'app/state/wallet/selectors' | ||
|
||
export const selectUnlockedStatus = createSelector([selectPersistSlice, selectIsOpen], (state, isOpen) => { | ||
if (state.hasPersistedProfiles) { | ||
if (state.stringifiedEncryptionKey === 'skipped') { | ||
if (isOpen) return 'openSkippedUnlockingProfile' | ||
return 'emptySkippedUnlockingProfile' | ||
export const selectUnlockedStatus = createSelector( | ||
[selectPersistSlice, selectHasAccounts], | ||
(state, hasAccounts) => { | ||
if (state.hasPersistedProfiles) { | ||
if (state.stringifiedEncryptionKey === 'skipped') { | ||
if (hasAccounts) return 'openSkippedUnlockingProfile' | ||
return 'emptySkippedUnlockingProfile' | ||
} | ||
if (state.stringifiedEncryptionKey) return 'unlockedProfile' | ||
return 'lockedProfile' | ||
} else { | ||
if (hasAccounts) return 'openUnpersisted' | ||
return 'emptyUnpersisted' | ||
} | ||
if (state.stringifiedEncryptionKey) return 'unlockedProfile' | ||
return 'lockedProfile' | ||
} else { | ||
if (isOpen) return 'openUnpersisted' | ||
return 'emptyUnpersisted' | ||
} | ||
}) | ||
}, | ||
) |
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
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