diff options
author | Eric Bailey <git@esb.lol> | 2023-11-10 08:46:45 -0600 |
---|---|---|
committer | Eric Bailey <git@esb.lol> | 2023-11-10 08:46:45 -0600 |
commit | b0c9cce5c3ea9246fbc2f71ac64c10c5252ec9a4 (patch) | |
tree | 510b14357ceff341a79c8947b9ea9b7e1fe4464d /src/view | |
parent | 742f53d1ecfc5060b7e6fc0cea0f8729d2e9b1b5 (diff) | |
download | voidsky-b0c9cce5c3ea9246fbc2f71ac64c10c5252ec9a4.tar.zst |
Follow conventions for query, use isDirty flag in session store to avoid unneccessary writes
Diffstat (limited to 'src/view')
-rw-r--r-- | src/view/com/auth/login/ChooseAccountForm.tsx | 4 | ||||
-rw-r--r-- | src/view/com/modals/SwitchAccount.tsx | 4 | ||||
-rw-r--r-- | src/view/screens/Settings.tsx | 4 | ||||
-rw-r--r-- | src/view/shell/desktop/LeftNav.tsx | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/src/view/com/auth/login/ChooseAccountForm.tsx b/src/view/com/auth/login/ChooseAccountForm.tsx index f1503e646..add997896 100644 --- a/src/view/com/auth/login/ChooseAccountForm.tsx +++ b/src/view/com/auth/login/ChooseAccountForm.tsx @@ -11,7 +11,7 @@ import {Trans, msg} from '@lingui/macro' import {useLingui} from '@lingui/react' import {styles} from './styles' import {useSession, useSessionApi, SessionAccount} from '#/state/session' -import {useGetProfile} from '#/data/useGetProfile' +import {useProfileQuery} from '#/state/queries/profile' function AccountItem({ account, @@ -22,7 +22,7 @@ function AccountItem({ }) { const pal = usePalette('default') const {_} = useLingui() - const {isError, data} = useGetProfile({did: account.did}) + const {isError, data} = useProfileQuery({did: account.did}) const onPress = React.useCallback(() => { onSelect(account) diff --git a/src/view/com/modals/SwitchAccount.tsx b/src/view/com/modals/SwitchAccount.tsx index 2ff70eea4..55ba69365 100644 --- a/src/view/com/modals/SwitchAccount.tsx +++ b/src/view/com/modals/SwitchAccount.tsx @@ -19,7 +19,7 @@ import {Haptics} from 'lib/haptics' import {Trans, msg} from '@lingui/macro' import {useLingui} from '@lingui/react' import {useSession, useSessionApi, SessionAccount} from '#/state/session' -import {useGetProfile} from '#/data/useGetProfile' +import {useProfileQuery} from '#/state/queries/profile' export const snapPoints = ['40%', '90%'] @@ -29,7 +29,7 @@ function SwitchAccountCard({account}: {account: SessionAccount}) { const {track} = useAnalytics() const {isSwitchingAccounts, currentAccount} = useSession() const {logout} = useSessionApi() - const {isError, data: profile} = useGetProfile({did: account.did}) + const {isError, data: profile} = useProfileQuery({did: account.did}) const isCurrentAccount = account.did === currentAccount?.did const {onPressSwitchAccount} = useAccountSwitcher() diff --git a/src/view/screens/Settings.tsx b/src/view/screens/Settings.tsx index 4fd2f2d53..cff92f8fd 100644 --- a/src/view/screens/Settings.tsx +++ b/src/view/screens/Settings.tsx @@ -58,7 +58,7 @@ import { useSetRequireAltTextEnabled, } from '#/state/preferences' import {useSession, useSessionApi, SessionAccount} from '#/state/session' -import {useGetProfile} from '#/data/useGetProfile' +import {useProfileQuery} from '#/state/queries/profile' // TEMPORARY (APP-700) // remove after backend testing finishes @@ -72,7 +72,7 @@ function SettingsAccountCard({account}: {account: SessionAccount}) { const pal = usePalette('default') const {isSwitchingAccounts, currentAccount} = useSession() const {logout} = useSessionApi() - const {isError, data} = useGetProfile({did: account.did}) + const {isError, data} = useProfileQuery({did: account.did}) const isCurrentAccount = account.did === currentAccount?.did const {onPressSwitchAccount} = useAccountSwitcher() diff --git a/src/view/shell/desktop/LeftNav.tsx b/src/view/shell/desktop/LeftNav.tsx index 3a0c0c95d..45be67d2c 100644 --- a/src/view/shell/desktop/LeftNav.tsx +++ b/src/view/shell/desktop/LeftNav.tsx @@ -41,7 +41,7 @@ import {router} from '../../../routes' import {makeProfileLink} from 'lib/routes/links' import {useLingui} from '@lingui/react' import {Trans, msg} from '@lingui/macro' -import {useGetProfile} from '#/data/useGetProfile' +import {useProfileQuery} from '#/state/queries/profile' import {useSession} from '#/state/session' const ProfileCard = observer(function ProfileCardImpl() { @@ -50,7 +50,7 @@ const ProfileCard = observer(function ProfileCardImpl() { isLoading, isError, data: profile, - } = useGetProfile({did: currentAccount!.did}) + } = useProfileQuery({did: currentAccount!.did}) const {isDesktop} = useWebMediaQueries() const size = 48 |