mirror of
https://github.com/spacedriveapp/spacedrive
synced 2024-07-02 10:03:28 +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';
|
import { useLocale } from '~/hooks';
|
||||||
|
|
||||||
export function SpacedriveAccount() {
|
export function SpacedriveAccount() {
|
||||||
|
const authState = auth.useStateSnapshot();
|
||||||
|
const me = useBridgeQuery(['auth.me'], { retry: false });
|
||||||
|
|
||||||
|
if (authState.status === 'loggedIn') {
|
||||||
|
me.refetch();
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card className="relative">
|
<Card className="relative">
|
||||||
<AuthRequiredOverlay />
|
<AuthRequiredOverlay />
|
||||||
<Account />
|
<Account data={me.data!} />
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function Account() {
|
function Account(props: { data: { id: string; email: string } }) {
|
||||||
const me = useBridgeQuery(['auth.me'], { retry: false });
|
|
||||||
const { t } = useLocale();
|
const { t } = useLocale();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -25,7 +31,7 @@ function Account() {
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
<hr className="mb-4 mt-2 w-full border-app-line" />
|
<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>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue