Only show 'Set as default' if has more than 1 account

pull/49/head
Lim Chee Aun 2023-01-25 16:42:01 +08:00
rodzic c24a3ef251
commit d2c820ce5a
1 zmienionych plików z 14 dodań i 12 usunięć

Wyświetl plik

@ -105,18 +105,20 @@ function Settings({ onClose }) {
</button>
}
>
<MenuItem
disabled={isDefault || !moreThanOneAccount}
onClick={() => {
// Move account to the top of the list
accounts.splice(i, 1);
accounts.unshift(account);
store.local.setJSON('accounts', accounts);
setCurrentDefault(i);
}}
>
Set as default
</MenuItem>
{moreThanOneAccount && (
<MenuItem
disabled={isDefault}
onClick={() => {
// Move account to the top of the list
accounts.splice(i, 1);
accounts.unshift(account);
store.local.setJSON('accounts', accounts);
setCurrentDefault(i);
}}
>
Set as default
</MenuItem>
)}
<MenuItem
disabled={!isCurrent}
onClick={() => {