solve camera off focus, load user histories

This commit is contained in:
heyethereum
2024-07-22 00:41:05 +08:00
parent a6c5fc8f05
commit 220fa2dfd4
15 changed files with 329 additions and 137 deletions

View File

@@ -1,15 +1,6 @@
import { useState, useEffect } from 'react';
import { fetchUserAttributes } from 'aws-amplify/auth';
interface UserAttributes {
email: string;
email_verified: string;
family_name: string;
given_name: string;
identities: string;
name: string;
sub: string;
}
import { UserAttributes } from '../types'
const useFetchUserAttributes = () => {
const [userAttributes, setUserAttributes] = useState<UserAttributes | null>(null);
@@ -22,6 +13,8 @@ const useFetchUserAttributes = () => {
const attributes = await fetchUserAttributes();
setUserAttributes(attributes as unknown as UserAttributes);
} catch (error: any) {
console.log("Error in use fetch user attributes: ", error);
setError(error.message);
} finally {
setLoading(false);