mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-24 16:58:47 +01:00
Only show Switch menu items when more than 1 account
This commit is contained in:
parent
75853cd8e4
commit
c3eb33e230
1 changed files with 25 additions and 21 deletions
|
@ -110,28 +110,32 @@ function Accounts({ onClose }) {
|
|||
</button>
|
||||
}
|
||||
>
|
||||
<MenuItem
|
||||
disabled={isCurrent}
|
||||
onClick={() => {
|
||||
setCurrentAccountID(account.info.id);
|
||||
location.reload();
|
||||
}}
|
||||
>
|
||||
<Icon icon="transfer" />{' '}
|
||||
<Trans>Switch to this account</Trans>
|
||||
</MenuItem>
|
||||
{!isStandalone && !isCurrent && (
|
||||
<MenuLink
|
||||
href={`./?account=${account.info.id}`}
|
||||
target="_blank"
|
||||
>
|
||||
<Icon icon="external" />
|
||||
<span>
|
||||
<Trans>Switch in new tab/window</Trans>
|
||||
</span>
|
||||
</MenuLink>
|
||||
{moreThanOneAccount && (
|
||||
<>
|
||||
<MenuItem
|
||||
disabled={isCurrent}
|
||||
onClick={() => {
|
||||
setCurrentAccountID(account.info.id);
|
||||
location.reload();
|
||||
}}
|
||||
>
|
||||
<Icon icon="transfer" />{' '}
|
||||
<Trans>Switch to this account</Trans>
|
||||
</MenuItem>
|
||||
{!isStandalone && !isCurrent && (
|
||||
<MenuLink
|
||||
href={`./?account=${account.info.id}`}
|
||||
target="_blank"
|
||||
>
|
||||
<Icon icon="external" />
|
||||
<span>
|
||||
<Trans>Switch in new tab/window</Trans>
|
||||
</span>
|
||||
</MenuLink>
|
||||
)}
|
||||
<MenuDivider />
|
||||
</>
|
||||
)}
|
||||
<MenuDivider />
|
||||
<MenuItem
|
||||
onClick={() => {
|
||||
states.showAccount = `${account.info.username}@${account.instanceURL}`;
|
||||
|
|
Loading…
Reference in a new issue