Skip to content

Commit

Permalink
Merge remote-tracking branch 'benma/escape'
Browse files Browse the repository at this point in the history
  • Loading branch information
benma committed Jul 23, 2024
2 parents 4f01273 + 14fdd7a commit c221fca
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 8 deletions.
6 changes: 2 additions & 4 deletions frontends/web/src/components/dialog/dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ type TProps = {
large?: boolean;
slim?: boolean;
centered?: boolean;
disableEscape?: boolean;
onClose?: (e?: Event) => void;
children: React.ReactNode;
open: boolean;
Expand All @@ -41,7 +40,6 @@ export const Dialog = ({
large,
slim,
centered,
disableEscape,
onClose,
children,
open,
Expand Down Expand Up @@ -169,10 +167,10 @@ export const Dialog = ({
if (!renderDialog) {
return;
}
if (!disableEscape) {
if (onClose !== undefined) {
deactivate(true);
}
}, [renderDialog, disableEscape, deactivate]));
}, [renderDialog, onClose, deactivate]));

useEffect(() => {
if (open) {
Expand Down
1 change: 0 additions & 1 deletion frontends/web/src/routes/account/receive/receive-bb01.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ export const Receive = ({
<Dialog
open={((!!account) && forceVerification && verifying)}
title={verifyLabel}
disableEscape={true}
medium centered>
<div className="text-center">
{account && <>
Expand Down
3 changes: 1 addition & 2 deletions frontends/web/src/routes/account/receive/receive.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,8 @@ export const Receive = ({
<Dialog
open={!!(account && verifying)}
title={t('receive.verifyBitBox02')}
// disable escape for secure outputs like the BitBox02, where the dialog is
// disable exit/escape for secure outputs like the BitBox02, where the dialog is
// dimissed by tapping the device
disableEscape={verifying === 'secure'}
onClose={verifying === 'insecure' ? () => {
setVerifying(false);
} : undefined}
Expand Down
1 change: 0 additions & 1 deletion frontends/web/src/routes/buy/pocket.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ export const Pocket = ({ code }: TProps) => {
<Dialog
open={verifying}
title={t('receive.verifyBitBox02')}
disableEscape={true}
medium centered>
<div className="text-center">{t('buy.pocket.verifyBitBox02')}</div>
</Dialog>
Expand Down

0 comments on commit c221fca

Please sign in to comment.