src/store/models/user.js
// Receives Cognito user. If Empty gets current authenticated user.
Receives Cognito user. If Empty gets current authenticated user.
Receives Cognito user . If Empty gets current authenticated user .
async loadUser(_userData) {
			try {
				let userData = _userData;
				if (isEmpty(userData)) {
					userData = await Auth.currentAuthenticatedUser();
				}
				const userAttributes = await getUserAttributes(userData);
				const loadedUser = Object.assign({}, userData, {
					attributes: {
						...userData.attributes,
						...userAttributes
					}
				});
				dispatch.user.set(loadedUser);
			} catch (e) {
				handleException(e);
				dispatch.user.set(null);
			}
		}
async loadUser ( _userData ) { try { let userData = _userData ; if ( isEmpty ( userData ) ) { userData = await Auth . currentAuthenticatedUser ( ) ; } const userAttributes = await getUserAttributes ( userData ) ; const loadedUser = Object . assign ( { } , userData , { attributes : { ... userData . attributes , ... userAttributes } } ) ; dispatch . user . set ( loadedUser ) ; } catch ( e ) { handleException ( e ) ; dispatch . user . set ( null ) ; } }
Receives Cognito user.
Receives Cognito user .
// loadChatSession(loadedUser);