From d2c820ce5a0585888d5ff1fdb809b1712af274a5 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Wed, 25 Jan 2023 16:42:01 +0800 Subject: [PATCH] Only show 'Set as default' if has more than 1 account --- src/pages/settings.jsx | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/pages/settings.jsx b/src/pages/settings.jsx index d0b5468e..ba27dbb5 100644 --- a/src/pages/settings.jsx +++ b/src/pages/settings.jsx @@ -105,18 +105,20 @@ function Settings({ onClose }) { } > - { - // 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 - + {moreThanOneAccount && ( + { + // 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 + + )} {