From 39c7f7adc66b7c9a8aa3d09f81c749268b03b12e Mon Sep 17 00:00:00 2001 From: Anthony Potdevin Date: Mon, 17 Aug 2020 19:57:43 +0200 Subject: [PATCH] =?UTF-8?q?chore:=20=F0=9F=94=A7=20settings=20changes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/settings/Account.tsx | 38 +--------------------------------- src/views/settings/Danger.tsx | 8 +++---- 2 files changed, 5 insertions(+), 41 deletions(-) diff --git a/src/views/settings/Account.tsx b/src/views/settings/Account.tsx index f2320589..8503168a 100644 --- a/src/views/settings/Account.tsx +++ b/src/views/settings/Account.tsx @@ -3,7 +3,7 @@ import { LogOut } from 'react-feather'; import { useRouter } from 'next/router'; import { chartColors } from 'src/styles/Themes'; import { useLogoutMutation } from 'src/graphql/mutations/__generated__/logout.generated'; -import { useAccounts, useAccount } from 'src/hooks/UseAccount'; +import { useAccount } from 'src/hooks/UseAccount'; import { CardWithTitle, SubTitle, @@ -12,10 +12,6 @@ import { } from '../../components/generic/Styled'; import { SettingsLine } from '../../../pages/settings'; import { ColorButton } from '../../components/buttons/colorButton/ColorButton'; -import { - MultiButton, - SingleButton, -} from '../../components/buttons/multiButton/MultiButton'; import { appendBasePath } from '../../utils/basePath'; import { useChatDispatch } from '../../context/ChatContext'; @@ -28,7 +24,6 @@ export const AccountSettings = () => { refetchQueries: ['GetServerAccounts'], }); - const accounts = useAccounts(); const account = useAccount(); useEffect(() => { @@ -42,41 +37,10 @@ export const AccountSettings = () => { return null; } - const renderChangeAccount = () => { - if (accounts.length <= 1) { - return null; - } - - return ( - - Change Account - - {accounts.map(({ name: accountName, id: accountId }) => { - return ( - { - if (accountId !== account.id) { - dispatchChat({ type: 'disconnected' }); - push(appendBasePath('/')); - } - }} - > - {accountName} - - ); - })} - - - ); - }; - return ( Account - {renderChangeAccount()} Logout { Danger Zone - Delete all accounts, chats and settings: + Delete chats and settings: - Delete All + Delete @@ -84,8 +84,8 @@ export const DangerView = () => { - This does not affect in any way your node, only the ThunderHub - accounts saved in this browser. + This does not affect in any way your node, only the information + saved in this browser.