mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-02 14:16:39 +01:00
Only show 'Set as default' if has more than 1 account
This commit is contained in:
parent
c24a3ef251
commit
d2c820ce5a
1 changed files with 14 additions and 12 deletions
|
@ -105,18 +105,20 @@ function Settings({ onClose }) {
|
||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<MenuItem
|
{moreThanOneAccount && (
|
||||||
disabled={isDefault || !moreThanOneAccount}
|
<MenuItem
|
||||||
onClick={() => {
|
disabled={isDefault}
|
||||||
// Move account to the top of the list
|
onClick={() => {
|
||||||
accounts.splice(i, 1);
|
// Move account to the top of the list
|
||||||
accounts.unshift(account);
|
accounts.splice(i, 1);
|
||||||
store.local.setJSON('accounts', accounts);
|
accounts.unshift(account);
|
||||||
setCurrentDefault(i);
|
store.local.setJSON('accounts', accounts);
|
||||||
}}
|
setCurrentDefault(i);
|
||||||
>
|
}}
|
||||||
Set as default
|
>
|
||||||
</MenuItem>
|
Set as default
|
||||||
|
</MenuItem>
|
||||||
|
)}
|
||||||
<MenuItem
|
<MenuItem
|
||||||
disabled={!isCurrent}
|
disabled={!isCurrent}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|
Loading…
Reference in a new issue