diff --git a/packages/web/src/javascripts/Components/Footer/AccountMenuButton.tsx b/packages/web/src/javascripts/Components/Footer/AccountMenuButton.tsx index eb918525d1b..b76351e8772 100644 --- a/packages/web/src/javascripts/Components/Footer/AccountMenuButton.tsx +++ b/packages/web/src/javascripts/Components/Footer/AccountMenuButton.tsx @@ -4,16 +4,19 @@ import AccountMenu, { AccountMenuProps } from '../AccountMenu/AccountMenu' import Icon from '../Icon/Icon' import Popover from '../Popover/Popover' import StyledTooltip from '../StyledTooltip/StyledTooltip' +import { observer } from 'mobx-react-lite' +import { AccountMenuController } from '@/Controllers/AccountMenu/AccountMenuController' type Props = AccountMenuProps & { - isOpen: boolean + controller: AccountMenuController hasError: boolean toggleMenu: () => void user: unknown } -const AccountMenuButton = ({ hasError, isOpen, mainApplicationGroup, onClickOutside, toggleMenu, user }: Props) => { +const AccountMenuButton = ({ hasError, controller, mainApplicationGroup, onClickOutside, toggleMenu, user }: Props) => { const buttonRef = useRef(null) + const { show: isOpen } = controller return ( <> @@ -46,4 +49,4 @@ const AccountMenuButton = ({ hasError, isOpen, mainApplicationGroup, onClickOuts ) } -export default AccountMenuButton +export default observer(AccountMenuButton) diff --git a/packages/web/src/javascripts/Components/Footer/Footer.tsx b/packages/web/src/javascripts/Components/Footer/Footer.tsx index 68ce0b44863..3fd353eaf74 100644 --- a/packages/web/src/javascripts/Components/Footer/Footer.tsx +++ b/packages/web/src/javascripts/Components/Footer/Footer.tsx @@ -36,7 +36,6 @@ type State = { showBetaWarning: boolean showSyncResolution: boolean newUpdateAvailable: boolean - showAccountMenu: boolean offline: boolean hasError: boolean arbitraryStatusMessage?: string @@ -62,7 +61,6 @@ class Footer extends AbstractComponent { showBetaWarning: false, showSyncResolution: false, newUpdateAvailable: false, - showAccountMenu: false, } this.webEventListenerDestroyer = props.application.addWebEventObserver((event, data) => { @@ -119,12 +117,6 @@ class Footer extends AbstractComponent { arbitraryStatusMessage: message, }) }) - - this.autorun(() => { - this.setState({ - showAccountMenu: this.application.accountMenuController.show, - }) - }) } reloadUpgradeStatus() { @@ -347,7 +339,7 @@ class Footer extends AbstractComponent {