mirror of
https://github.com/spacedriveapp/spacedrive
synced 2024-06-30 11:23:33 +00:00
I think I fixed it?
This commit is contained in:
parent
7743796163
commit
82baeee0bb
|
@ -4,16 +4,22 @@ import { AuthRequiredOverlay } from '~/components/AuthRequiredOverlay';
|
|||
import { useLocale } from '~/hooks';
|
||||
|
||||
export function SpacedriveAccount() {
|
||||
const authState = auth.useStateSnapshot();
|
||||
const me = useBridgeQuery(['auth.me'], { retry: false });
|
||||
|
||||
if (authState.status === 'loggedIn') {
|
||||
me.refetch();
|
||||
}
|
||||
|
||||
return (
|
||||
<Card className="relative">
|
||||
<AuthRequiredOverlay />
|
||||
<Account />
|
||||
<Account data={me.data!} />
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
|
||||
function Account() {
|
||||
const me = useBridgeQuery(['auth.me'], { retry: false });
|
||||
function Account(props: { data: { id: string; email: string } }) {
|
||||
const { t } = useLocale();
|
||||
|
||||
return (
|
||||
|
@ -25,7 +31,7 @@ function Account() {
|
|||
</Button>
|
||||
</div>
|
||||
<hr className="mb-4 mt-2 w-full border-app-line" />
|
||||
<span>{t('logged_in_as', { email: me.data?.email })}</span>
|
||||
<span>{t('logged_in_as', { email: props.data.email })}</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue