1import { setSessionAsync } from '../apiClient';
2import { restoreSessionAsync } from '../native-modules/DevLauncherAuth';
3import { getUserProfileAsync } from './getUserProfileAsync';
4
5export async function restoreUserAsync() {
6  const session = await restoreSessionAsync();
7
8  if (session) {
9    // @ts-ignore
10    await setSessionAsync(session);
11    const userData = await getUserProfileAsync();
12    return userData;
13  }
14
15  return undefined;
16}
17