Only show Switch menu items when more than 1 account

This commit is contained in:
Lim Chee Aun 2024-08-25 17:53:24 +08:00
parent 75853cd8e4
commit c3eb33e230

View file

@ -110,28 +110,32 @@ function Accounts({ onClose }) {
</button> </button>
} }
> >
<MenuItem {moreThanOneAccount && (
disabled={isCurrent} <>
onClick={() => { <MenuItem
setCurrentAccountID(account.info.id); disabled={isCurrent}
location.reload(); onClick={() => {
}} setCurrentAccountID(account.info.id);
> location.reload();
<Icon icon="transfer" />{' '} }}
<Trans>Switch to this account</Trans> >
</MenuItem> <Icon icon="transfer" />{' '}
{!isStandalone && !isCurrent && ( <Trans>Switch to this account</Trans>
<MenuLink </MenuItem>
href={`./?account=${account.info.id}`} {!isStandalone && !isCurrent && (
target="_blank" <MenuLink
> href={`./?account=${account.info.id}`}
<Icon icon="external" /> target="_blank"
<span> >
<Trans>Switch in new tab/window</Trans> <Icon icon="external" />
</span> <span>
</MenuLink> <Trans>Switch in new tab/window</Trans>
</span>
</MenuLink>
)}
<MenuDivider />
</>
)} )}
<MenuDivider />
<MenuItem <MenuItem
onClick={() => { onClick={() => {
states.showAccount = `${account.info.username}@${account.instanceURL}`; states.showAccount = `${account.info.username}@${account.instanceURL}`;