diff options
author | Eric Bailey <git@esb.lol> | 2023-11-09 17:14:51 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-09 15:14:51 -0800 |
commit | 625cbc435f15bc0d611661b44dbf8add990dff7d (patch) | |
tree | c0bdafd65783a52410c874721510f73fbc9a9828 /src/view/com/util/AccountDropdownBtn.tsx | |
parent | 664e7a91a96dfea08d47162ce67adb04412696c0 (diff) | |
download | voidsky-625cbc435f15bc0d611661b44dbf8add990dff7d.tar.zst |
First pass at a session handler (#1850)
* First pass at a session handler * TODOs * Fix recursion * Couple more things * Add back resume session concept * Handle ready * Cleanup of initial loading states * Handle init failure * Cleanup * Remove account * Add updateCurrentAccount * Remove log * Cleanup * Integrate removeAccount * Add hasSession * Add to App.native, harden migration * Use effect to persist data
Diffstat (limited to 'src/view/com/util/AccountDropdownBtn.tsx')
-rw-r--r-- | src/view/com/util/AccountDropdownBtn.tsx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/view/com/util/AccountDropdownBtn.tsx b/src/view/com/util/AccountDropdownBtn.tsx index 2042531e9..158ed9b6d 100644 --- a/src/view/com/util/AccountDropdownBtn.tsx +++ b/src/view/com/util/AccountDropdownBtn.tsx @@ -5,23 +5,23 @@ import { FontAwesomeIconStyle, } from '@fortawesome/react-native-fontawesome' import {s} from 'lib/styles' -import {useStores} from 'state/index' import {usePalette} from 'lib/hooks/usePalette' import {DropdownItem, NativeDropdown} from './forms/NativeDropdown' import * as Toast from '../../com/util/Toast' +import {useSessionApi} from '#/state/session' import {useLingui} from '@lingui/react' import {msg} from '@lingui/macro' export function AccountDropdownBtn({handle}: {handle: string}) { - const store = useStores() const pal = usePalette('default') + const {removeAccount} = useSessionApi() const {_} = useLingui() const items: DropdownItem[] = [ { label: 'Remove account', onPress: () => { - store.session.removeAccount(handle) + removeAccount({handle}) Toast.show('Account removed from quick access') }, icon: { |