mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-19 20:03:51 +01:00
feat: more login progress
This commit is contained in:
1 parent
1e64cb9e7d
commit
513105a624
18 files changed
+290
-295
No files matched your search
@@ -1,22 +1,19 @@
|
||||
import { getAccountInfo, idToRegion } from '@blitzkit/core';
|
||||
import { useStore } from '@nanostores/react';
|
||||
import { Text } from '@radix-ui/themes';
|
||||
import { useMemo } from 'react';
|
||||
import usePromise from 'react-promise-suspense';
|
||||
import { $wargamingLogin } from '../stores/wargamingLogin';
|
||||
import { App } from '../stores/app';
|
||||
|
||||
export function WargamingAccountName() {
|
||||
const wargaming = useStore($wargamingLogin);
|
||||
const wargaming = App.use((state) => state.logins.wargaming);
|
||||
const promise = useMemo(async () => {
|
||||
if (!wargaming.token) return null;
|
||||
if (!wargaming) return null;
|
||||
|
||||
const data = await getAccountInfo(
|
||||
idToRegion(Number(wargaming.id)),
|
||||
Number(wargaming.id),
|
||||
idToRegion(wargaming.id),
|
||||
wargaming.id,
|
||||
[],
|
||||
{
|
||||
access_token: wargaming.token,
|
||||
},
|
||||
{ access_token: wargaming.token },
|
||||
);
|
||||
|
||||
return data?.nickname as string | undefined;
|
||||
|
||||
Reference in new issue
Block a user