Skip to content

Commit

Permalink
Properly close modals when naming accounts is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
buberdds committed Oct 13, 2023
1 parent 42a99f1 commit be9ab93
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ import { ManageableAccountEditModal } from './ManageableAccountEditModal'
import { Wallet } from '../../../../state/wallet/types'

export const ManageableAccount = ({
closeHandler,
editHandler,
wallet,
isActive,
onClick,
}: {
closeHandler: () => any
editHandler?: (name: string) => void
wallet: Wallet
isActive: boolean
Expand All @@ -32,6 +34,7 @@ export const ManageableAccount = ({
/>
{layerVisibility && (
<ManageableAccountEditModal
closeParentHandler={closeHandler}
closeHandler={() => setLayerVisibility(false)}
editHandler={editHandler}
wallet={wallet}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ interface FormValue {
export const ManageableAccountEditModal = ({
animation,
closeHandler,
closeParentHandler,
editHandler,
wallet,
}: {
animation?: boolean
closeHandler: () => void
closeParentHandler?: () => void
editHandler?: (name: string) => void
wallet: Wallet
}) => {
Expand Down Expand Up @@ -74,7 +76,7 @@ export const ManageableAccountEditModal = ({
<Button
color="link"
onClick={() => {
closeHandler()
closeParentHandler ? closeParentHandler() : closeHandler()
navigate('/open-wallet')
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const AccountSelector = memo((props: Props) => {

const accounts = Object.values(wallets).map(wallet => (
<ManageableAccount
closeHandler={props.closeHandler}
editHandler={
unlockedProfile
? (name: string) => {
Expand Down

0 comments on commit be9ab93

Please sign in to comment.