Skip to content

Commit

Permalink
Hide the toast when outside click
Browse files Browse the repository at this point in the history
  • Loading branch information
darkwing committed Mar 23, 2024
1 parent b231c5c commit 0d2026c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ui/pages/routes/routes.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -695,13 +695,21 @@ export default class Routes extends Component {
);
///: END:ONLY_INCLUDE_IF

const showAutoNetworkSwitchToast =
switchedNetworkDetails && !neverShowSwitchedNetworkMessage;

return (
<div
className={classnames('app', {
[`os-${os}`]: os,
[`browser-${browser}`]: browser,
})}
dir={textDirection}
onMouseUp={
showAutoNetworkSwitchToast
? () => setSwitchedNetworkDetails(null)
: undefined
}
>
{shouldShowNetworkDeprecationWarning ? <DeprecatedNetworks /> : null}
{shouldShowNetworkInfo && <NewNetworkInfo />}
Expand Down Expand Up @@ -788,7 +796,7 @@ export default class Routes extends Component {
onClose={() => this.setState({ hideConnectAccountToast: true })}
/>
) : null}
{switchedNetworkDetails && !neverShowSwitchedNetworkMessage ? (
{showAutoNetworkSwitchToast ? (
<Toast
key="switched-network-toast"
startAdornment={
Expand Down

0 comments on commit 0d2026c

Please sign in to comment.